cert-manager certificate not renewing: how to debug it on Kubernetes

A cert-manager Certificate stuck not Ready or about to expire? Follow the chain from Certificate to Challenge with kubectl and fix the usual HTTP-01 and DNS-01 causes.

· 7 min read · By the Spot Downtime team

cert-manager issues and renews TLS certificates for Kubernetes automatically, which is why failures go unnoticed. The first certificate works, everyone forgets about it, and weeks later a renewal fails. Unless something checks, the first sign is a browser warning for visitors.

This post shows how to follow a stuck certificate through cert-manager's resources, the most common causes, and how to get an alert before expiry.

How renewal works

cert-manager renews a certificate once a configured fraction of its lifetime has passed. By default it starts renewing when a third of the lifetime remains, which is about 30 days before expiry for a 90-day certificate. You can set renewBefore on the Certificate to change it. A failed attempt is retried with a growing delay, so a problem can sit for days while the old certificate quietly runs down.

A renewal passes through a chain of resources, and the failure is recorded on the one that broke:

  • Certificate: what you asked for. Its Ready condition is the summary.
  • CertificateRequest: the signing request sent to the issuer.
  • Order and Challenge: for ACME issuers such as Let's Encrypt, the proof that you control the domain.

Walk the chain with kubectl

bash
# Overview: is anything not Ready?
kubectl get certificate -A

# Conditions and recent events for one certificate
kubectl describe certificate example-com-tls -n web

# Follow the chain
kubectl get certificaterequest,order,challenge -n web
kubectl describe challenge -n web

# Expiry of the certificate currently in the Secret
kubectl get secret example-com-tls -n web -o jsonpath='{.data.tls\.crt}' \
  | base64 -d | openssl x509 -noout -dates -subject

Start at the Certificate. If its message says the CertificateRequest was denied or the issuer is not ready, look at the issuer. If it points to a pending Order, go on to the Challenge, where the reason is usually spelled out in the Status section. If you have it installed, cmctl status certificate example-com-tls -n web prints the same chain in one view.

Common causes

HTTP-01: the challenge URL is not reachable

Let's Encrypt requests http://your-domain/.well-known/acme-challenge/TOKEN over plain HTTP on port 80. It fails when:

  • A redirect to HTTPS or an auth layer intercepts the path before cert-manager's solver can answer it.
  • Port 80 is closed at the load balancer or firewall.
  • The DNS record points somewhere other than the cluster ingress, or IPv6 (AAAA) points at a host that does not serve the challenge.
  • The solver Ingress uses the wrong ingressClassName for your controller.
  • A network policy blocks traffic to the solver pod.

Test from outside the cluster: curl -i http://example.com/.well-known/acme-challenge/test. You should reach your ingress and get a 404 from the solver, not a redirect or a timeout. A cert-manager Challenge also does its own self-check first, and its status message tells you if that check failed.

DNS-01: credentials or propagation

DNS-01 creates a TXT record at _acme-challenge.your-domain. It fails when the API credentials in the issuer are wrong or expired, lack permission on the zone, point at a different zone than the one that serves your domain, or when a stale CNAME at that name interferes. Wildcard certificates require DNS-01. Check what the world sees with a DNS lookup on the TXT name, and see DNS propagation explained if the record exists but is not visible yet.

Issuer problems

  • The Certificate names an issuer or ClusterIssuer that does not exist or is not Ready. Run kubectl describe clusterissuer.
  • The ACME account key Secret was deleted, so registration fails.
  • The cert-manager pods are down or cannot reach the internet. Check kubectl logs -n cert-manager deploy/cert-manager.

Rate limits

Let's Encrypt limits how many certificates and failed validations you can request in a period. Repeated failed attempts or recreating certificates in a loop can hit them, and the error text names the limit. While debugging, use the staging issuer so failures do not count against production limits. The general renewal checklist is in Let's Encrypt renewal failed.

The Secret is renewed but the old certificate is still served

cert-manager updates the Secret, but the workload using it may not reload. Some ingress controllers pick it up automatically. Applications that read the files at startup need a restart or a reloader. Compare the dates in the Secret with what the live endpoint serves, using the command above and the SSL checker.

Forcing a renewal after a fix

bash
# With cmctl
cmctl renew example-com-tls -n web

# Or delete the failed CertificateRequest so a new one is created
kubectl delete certificaterequest -n web <name>

Fix the root cause first. Renewing repeatedly against a broken challenge only consumes rate limit.

Alert before it expires

cert-manager can only tell you about problems it notices, and a deleted Certificate or a stopped controller produces no failure at all. An external check on the endpoint that visitors use catches every cause, because it looks at the certificate that is actually served. Spot Downtime's SSL monitoring checks expiry from outside the cluster, and SSL expiry alert lead times suggests when to warn. With a 30-day renewal window, an alert at 14 days left means renewal has already been failing for more than two weeks, which is a useful signal on its own. See also how to monitor SSL and domain expiry.

If it already expired

Visitors will see a certificate error right now. Issue a replacement as fast as you can, then debug the renewal. The symptoms and quick fixes are in SSL certificate expired.

Checklist

  • kubectl get certificate -A shows every certificate Ready.
  • Port 80 reaches the ingress, and nothing redirects or blocks /.well-known/acme-challenge/.
  • DNS-01 credentials are valid and scoped to the right zone.
  • Issuers are Ready and the ACME account Secret exists.
  • Workloads reload renewed certificates.
  • An external expiry alert watches the live endpoint.

Check what is served now

SSL checkerSee the certificate your domain serves, its expiry date and whether the chain is complete.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading