Created
April 27, 2019 21:31
-
-
Save kainlite/f1c22fae8ea806a4b11921133993c204 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generate the CA | |
| $ cfssl gencert -initca certs/config/ca-csr.json | cfssljson -bare certs/ca | |
| # Generate the certificate for Consul | |
| $ cfssl gencert \ | |
| -ca=certs/ca.pem \ | |
| -ca-key=certs/ca-key.pem \ | |
| -config=certs/config/ca-config.json \ | |
| -profile=default \ | |
| certs/config/consul-csr.json | cfssljson -bare certs/consul | |
| # Generate the certificate for Vault | |
| $ cfssl gencert \ | |
| -ca=certs/ca.pem \ | |
| -ca-key=certs/ca-key.pem \ | |
| -config=certs/config/ca-config.json \ | |
| -profile=default \ | |
| certs/config/vault-csr.json | cfssljson -bare certs/vault | |
| ``` | |
| # Create an encryption key for the gossip protocol | |
| export GOSSIP_ENCRYPTION_KEY=$(consul keygen) | |
| # Save it as a secret in kubernetes | |
| kubectl create secret generic consul \ | |
| --from-literal="gossip-encryption-key=${GOSSIP_ENCRYPTION_KEY}" \ | |
| --from-file=certs/ca.pem \ | |
| --from-file=certs/consul.pem \ | |
| --from-file=certs/consul-key.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment