cert-manager renews certificates in Kubernetes on its own, until a challenge starts failing. It keeps the old certificate in place while it retries, so you find out when it expires. Here's how to find where it's stuck.
1. Which certificates aren't ready?
kubectl get certificate -A
Look for READY False. Then:
kubectl describe certificate example-com -n web
The Status and Events at the bottom show the last error and when it will try again.
Not After and Renewal Time tell you how much time is left.
2. Follow the chain down
A renewal goes Certificate → CertificateRequest → Order → Challenge. The error is usually at the bottom:
kubectl get certificaterequest,order,challenge -n web
kubectl describe challenge -n web
Challenges only exist while one is in progress. If there are none and the certificate still isn't ready, look at the CertificateRequest and the Order.
3. The usual reasons
- HTTP-01 can't be reached. The solver Ingress uses the wrong ingress class, or something in front (a firewall, a CDN,
a forced redirect) blocks
/.well-known/acme-challenge/. Try the URL from the Challenge's events with curl from outside. - DNS-01 credentials. The API token in the Secret expired or lost permissions for the zone.
- Issuer mismatch. The Certificate points at an
Issuerin another namespace, or at an Issuer when it should be aClusterIssuer. - Rate limits. Many failed attempts hit Let's Encrypt's limits. The Order shows it. Fix the cause and wait.
4. Renew by hand
Once the cause is fixed, don't wait for the next retry:
cmctl renew example-com -n web
cmctl is cert-manager's CLI and is installed separately.
5. Check what's actually served
A ready Certificate only means the Secret is up to date. Check that the ingress serves it:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -subject -enddate
If the subject says Kubernetes Ingress Controller Fake Certificate, ingress-nginx can't find the Secret named in the
Ingress's tls section. Check the name and namespace.
Finding out sooner
cert-manager renews when two thirds of the lifetime has passed, so about 30 days before a 90-day certificate expires.
If you scrape its metrics, alert on certmanager_certificate_ready_status{condition="False"} and on
certmanager_certificate_expiration_timestamp_seconds - time() < 21 * 86400. A check from outside the cluster
also sees what clients see, including a wrong or fake certificate.