How certificates live in Kubernetes
In Kubernetes, a certificate and its key are usually stored in a Secret of type kubernetes.io/tls. Ingress controllers and applications read the Secret. Renewal means replacing the contents of that Secret, then making sure everything that reads it uses the new contents.
cert-manager
cert-manager is the common way to issue and renew certificates inside a cluster. You declare a Certificate resource and an issuer, for example an ACME CA, and cert-manager keeps the Secret up to date. If you do not set renewBefore, cert-manager renews a certificate two thirds of the way through its lifetime, so a 90-day certificate is renewed after about 60 days.
Making the new certificate take effect
Updating the Secret is not always enough:
- Ingress controllers such as ingress-nginx watch TLS Secrets and load the new certificate without a restart.
- Applications that mount the Secret as a volume see the new files after a delay, but a Secret mounted with subPath is never updated. Many applications also read the certificate only at start-up, so they need a rolling restart.
- Applications that read the Secret into an environment variable only see the new value after a restart.
After each renewal, check the certificate the service actually serves, not only the Secret.
Certificates from outside the cluster
Not every certificate can come from cert-manager. OV and EV certificates, certificates from a CA without an issuer for cert-manager, and certificates shared with systems outside the cluster are often issued elsewhere and copied into a Secret by hand. Those copies are the ones that expire, a pattern we describe in why certificate tracking spreadsheets fail.
How clm.mt handles Kubernetes
clm.mt renews the certificate outside the cluster, writes it into the TLS Secret in the namespace you choose, can trigger a rolling restart of the workloads that use it, and can undo the change. Serving through an ingress controller has not been part of that test.
clm.mt status
Supported for Kubernetes TLS Secrets. A kind cluster passed creation, update, rolling restart and undo. Ingress served TLS has not been tested. See the integrations board for every tested scope, and the documentation to plan a pilot.
Other platform guides
- AD CS certificate autoenrollment and auto renewal
- AWS load balancer certificate renewal with ACM
- Azure Key Vault certificate auto renewal, and when it does not happen
- F5 BIG-IP SSL certificate renewal automation
- FortiGate ACME certificates and automatic renewal
- IIS SSL certificate auto renewal on Windows Server
- NetScaler ADC SSL certificate renewal and update
- NGINX SSL certificate auto renewal with ACME
- Palo Alto firewall certificate renewal automation