Security & multi-tenancyLesson 6 of 13
Automatic TLS Certificates with cert-manager
Follow one certificate from request to renewal: ClusterIssuer → Certificate → CertificateRequest → Order → Challenge → Secret. See how the CA checks that you control the domain, and which resource to read when issuance gets stuck.
Issuer—
Certificate—
Challenge—
Expires—
RequestResponse / reportWatchAppears in a later step
What you will learn
- An Issuer says which CA to use and how to prove domain control
- The chain Certificate → CertificateRequest → Order → Challenge
- HTTP-01 through a temporary solver, and why it gets stuck pending
- DNS-01 with a TXT record, required for wildcard names
- Renewal timing, rate limits and the staging server
Where to look when a certificate is stuck
Read the chain from top to bottom and stop at the first resource that is not ready or valid.
| Resource | Created by | What to check | Typical reason it is stuck |
|---|---|---|---|
| ClusterIssuer / Issuer | You | Ready condition | Wrong ACME URL, missing account key Secret, bad DNS provider credentials |
| Certificate | You, or ingress-shim from an annotation | Ready and Issuing conditions, status.renewalTime | Issuer name or kind wrong in issuerRef, names not covered by any solver |
| CertificateRequest | cert-manager, one per attempt | Ready, Approved, Denied | Issuer not ready, request not approved |
| Order | ACME issuer, one per request | state: pending, valid, invalid, errored | A Challenge failed, or a rate limit was hit |
| Challenge | ACME issuer, one per name | state and reason | DNS points elsewhere, port 80 blocked, TXT record not visible yet |
| Secret | cert-manager | tls.crt subject and expiry | Not created until the Certificate is Ready |
If a Certificate shows Ready=True but browsers still see the old certificate, check that the Ingress or Gateway really names the same Secret, in the same namespace.
Try it yourself
kubectl get clusterissuer # READY per issuer
kubectl describe clusterissuer letsencrypt-prod # ACME URL, account status
kubectl get certificate,certificaterequest,order,challenge -A # The whole chain at once
kubectl describe certificate shop-tls -n shop # Conditions and events
kubectl describe challenge -n shop # State, reason, self-check errors
cmctl status certificate shop-tls -n shop # Certificate, request, order and challenges in one view
cmctl renew shop-tls -n shop # Force a renewal now
curl -v http://shop.example.com/.well-known/acme-challenge/test # Is port 80 reachable from outside?
dig TXT _acme-challenge.example.com +short # Is the DNS-01 record visible?
kubectl get secret shop-tls -n shop -o jsonpath='{.data.tls\.crt}' \
| base64 -d | openssl x509 -noout -subject -enddate # Names and expiry of the issued cert
Check yourself
Further reading: cert-manager docs · ACME issuer · Securing Ingress resources · Troubleshooting ACME · Let's Encrypt challenge types · Let's Encrypt rate limits · Staging environment · HTTPS and Certificates · Ingress Rules and TLS