Updating the TLS certificates on Kubernetes
In Kubernetes, TLS certificates are contained within a secret called tls-secret.
Before you begin
About this task
Procedure
-
Run the following command to verify if the secret currently exists.
kubectl get secrets
-
If the tls-secret exists, delete it.
kubectl delete secret tls-secret
-
Create a new tls-secret secret with the new certificate
and private key.
create secret tls tls-secret --key tls.key --cert tls.crt
Where the value for key is the private key file and cert is the certificate file. -
Verify
kubectl get secret tls-secret -o yaml