Home How to create a TLS secret cert in a Kubernetes Cluster
Post
Cancel

How to create a TLS secret cert in a Kubernetes Cluster

In this tutorial I show you how to create a TLS secret in a Kubernetes cluster.

1. Purchase wildcard cert

I purchased a wildcard cert from GoDaddy. Another method would be to use LetsEncrypt to generate a free cert which requires a bit more work that I’ll cover in another post.

2. Download CSR and Private key

The key file didn’t work out of the gate but after opening and adding an empty line at the top of the file it should work.

3. Create secret in cluster

Make sure that you have switched your kubernetes context to the appropriate cluster then open a terminal and change directory to your unzipped cert folder

1
cd /path/to/certs/

then run the following against the cluster:

Note: Don’t forget to switch context to the appropriate cluster: Kubernetes Context

1
kubectl create secret tls your_secret_name --cert your_cert.crt --key your_private_key.key
This post is licensed under CC BY 4.0 by the author.