Skip to content

Instantly share code, notes, and snippets.

@sinfere
Forked from superseb/README.md
Created February 2, 2020 14:07
Show Gist options
  • Save sinfere/f2737658247f0fe7a2c5332d007da75b to your computer and use it in GitHub Desktop.
Save sinfere/f2737658247f0fe7a2c5332d007da75b 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