Skip to content

Instantly share code, notes, and snippets.

@harisvsulaiman
Forked from superseb/README.md
Created November 21, 2020 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harisvsulaiman/6353453f0f65880f24822fc40bc28124 to your computer and use it in GitHub Desktop.
Save harisvsulaiman/6353453f0f65880f24822fc40bc28124 to your computer and use it in GitHub Desktop.
Generate self signed certificates for Rancher 2.x

Generate self signed certificates for Rancher 2.x

Generate certificates

docker run -v $PWD/certs:/certs \
  -e SSL_SUBJECT=test.example.com \
  -e SSL_DNS=test.example.com,test2.example.com \
  -e SSL_IP=10.0.0.1 \
  superseb/omgwtfssl

Single install

docker run -d --restart=unless-stopped \
  -p 80:80 -p 443:443 \
  -v $PWD/certs/cert.pem:/etc/rancher/ssl/cert.pem \
  -v $PWD/certs/key.pem:/etc/rancher/ssl/key.pem \
  -v $PWD/certs/ca.pem:/etc/rancher/ssl/cacerts.pem \
  rancher/rancher:latest

HA install

Use the created certificate files to create the secrets in Kubernetes.

kubectl -n cattle-system create secret tls tls-rancher-ingress --cert=$PWD/certs/cert.pem --key=$PWD/certs/key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment