-
Notifications
You must be signed in to change notification settings - Fork 0
Consul Variables and Stuff (2015 11 20)
Jorge Silva edited this page Jan 20, 2017
·
7 revisions
Here's a detailed account of all the values in Consul and Vault required for all environments:
There's a few playbooks that can help you manage consul and vault:
-
consul.ymldeploys consul toapi,web, andservices -
vault.ymldeploys vault toservices -
consul-values.ymlinserts a bunch of seed data into consul-
write_valuesset toyesto actually write values
-
-
vault-values.ymlinserts a bunch of seed data into vault-
write_valuesset toyesto actually write values -
write_root_credsset toyesto actually write root credentials for the AWS backend
-
-
node/env(e.g.production) -
api/hostname(e.g.api.runnable.io)
note: these are still key/value pairs, but separating them out for clarity
image-builder/versiondocker-listener/versionfilibuster/versionkrain/versionsauron/versioncharon/version
-
secret/logglytoken=[token]
-
secret/rabbitmqusername=[username]password=[password]
-
secret/github/hellorunnabletoken=[github-token]
-
secret/swarmtoken=[swarm-token]
rabbitmqredisdatadogregistry
- New Vault Backends for new Environments
- Need to be initialized with TLS disabled.
ssh <box-running-vault>sudo docker exec -it $(sudo docker ps | grep 'vault' | awk '{print $1}') shvault init -address=http://127.0.0.1:8200- Record the output, it will be used for variables in devops-scripts
-
aws- Updpate the vault host
> export VAULT_ADDR=http://127.0.0.1:8200
Successfully authenticated!
- Authenticate user
vault auth $AUTH_TOKEN // (Initial Root Token)
- mount the backend
```bash
vault mount aws
- configure the root:
vault write aws/config/root \
access_key=[access-key] \
secret_key=[secret-key] \
region=[region (e.g. us-west-2)]- configure the
dock-initrole
vault write aws/roles/dock-init \
[email protected]- `policy.json` can be found in the [dock-init repo](https://github.com/CodeNow/dock-init/blob/master/consul-resources/policy.json) (link may be out of date, but path should be correct)
- can test this by doing
vault read aws/creds/dock-init
/ # vault write aws/roles/dock-init \
> [email protected]
Success! Data written to: aws/roles/dock-init
/ # vault read aws/creds/dock-init
Key Value
lease_id aws/creds/dock-init/0eba123a-eef4-86ad-5181-0ba961c78145
lease_duration 2592000
lease_renewable true
access_key AKIAJ3PJBTH2FTIPOM4Q
secret_key 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
security_token <nil>