Created
June 6, 2017 08:39
-
-
Save jengo/4d4257258c10db6ade8bd819c0d30796 to your computer and use it in GitHub Desktop.
Generate self signed TLS / SSL certificate as a Kubernetes secret
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
export HOSTNAME=localhost | |
export NAMESPACE=default | |
export SECRET_NAME=test-ssl-secret | |
openssl req -x509 -nodes -days 365 -sha256 -newkey rsa:2048 -keyout /tmp/tls.key -out /tmp/tls.crt -subj "/CN=${HOSTNAME}/" | |
kubectl --namespace ${NAMESPACE} create secret tls ${SECRET_NAME} --key /tmp/tls.key --cert /tmp/tls.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment