Manage SSL Certificates in Kubernetes
To manage SSL certificates in Kubernetes, let cert-manager request and renew them: install it, create a ClusterIssuer, then annotate the Ingress so a certificate is issued into a Secret.
How the pieces fit
| Resource | Role |
|---|---|
| Issuer / ClusterIssuer | Describes the CA and how to prove domain control |
| Certificate | Requests a certificate for specific names |
| Secret | Holds the issued key and certificate |
| Ingress | Uses the Secret to serve HTTPS |
| Challenge / Order | Temporary objects tracking an ACME validation |
An Issuer works within one namespace. A ClusterIssuer works in all of them, which is usually what you want for one shared Let's Encrypt account.
Step 1: Install cert-manager
Install it with Helm or the official manifest from the cert-manager project, following the current install page, and wait until its pods are ready:
kubectl get pods -n cert-manager
kubectl get crd | grep cert-manager.ioSSL certificates in Kubernetes: the ClusterIssuer
Begin with the Let's Encrypt staging server so that mistakes do not hit production rate limits. Staging certificates are not trusted by browsers, which is expected.
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: >-
https://acme-staging-v02.api.letsencrypt.org/directory
email: admin@example.com
privateKeySecretRef:
name: letsencrypt-staging-key
solvers:
- http01:
ingress:
ingressClassName: nginxApply it with kubectl apply -f. Once a staging certificate issues successfully, create a second ClusterIssuer with the production URL https://acme-v02.api.letsencrypt.org/directory and a different secret name. Use a real email address; the CA uses it for expiry notices.
Step 3: Request a certificate through an Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
annotations:
cert-manager.io/cluster-issuer: letsencrypt-staging
spec:
ingressClassName: nginx
tls:
- hosts: [app.example.com]
secretName: app-example-tls
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80cert-manager sees the annotation, creates a Certificate, solves the HTTP-01 challenge through the ingress, and writes the result to the app-example-tls Secret. Switch the annotation to the production issuer when staging works, and delete the old Secret so a fresh certificate is issued.
HTTP-01 or DNS-01
HTTP-01 needs the name to be reachable on port 80 from the internet and cannot issue wildcards. DNS-01 proves control by creating a TXT record, works for wildcards and for clusters that are not publicly reachable, but needs DNS provider credentials stored as a Secret. See using DNS-01 with Cloudflare for the concept and getting a wildcard certificate.
SSL certificates in Kubernetes: debug
kubectl get certificate -A
kubectl describe certificate app-example-tls
kubectl get challenges -A
kubectl describe challenge -AA Certificate with READY True is done. If it is stuck, describe on the Order and Challenge shows why. Typical causes are DNS not pointing at the cluster, a firewall blocking port 80, a wrong ingress class, or a rate limit. The fix for validation failures is often the same as outside Kubernetes; see fixing DNS validation errors.
Renewal and monitoring
By default cert-manager renews well before expiry and updates the Secret in place. Whether pods pick it up depends on the consumer. Ingress controllers watch Secrets and reload on their own. Pods that mount the Secret may need a restart or a reloader tool. Alert on certificate expiry with the metrics cert-manager exposes, and on any Certificate that is not ready. See also configuring SSL in Kubernetes for a simpler manual setup and automating certificate management.
Rate limits and safety
Let's Encrypt applies rate limits to production issuance. They change over time, so check the current Let's Encrypt documentation instead of relying on numbers in a blog post. Use staging while testing, avoid deleting and re-requesting the same certificate in a loop, and keep one ClusterIssuer account rather than creating a new one per namespace.
Related reading: the wider Kubernetes TLS guide, automating renewal outside a cluster and the Docker route.
Frequently Asked Questions
HTTP-01 or DNS-01 in a cluster?
HTTP-01 is simpler when the Ingress is reachable from the internet. DNS-01 is needed for wildcards and for clusters that are not publicly reachable, and it needs API credentials for your DNS provider.
Why is my Certificate stuck in a pending state?
Read the order and challenge objects, not just the Certificate. They carry the reason: a missing DNS record, an unreachable path, or a rate limit hit by repeated retries.
What happens when the certificate renews?
cert-manager writes a new Secret and the ingress controller picks it up. Pods that mount the Secret directly do not reload it on their own, so mount it as a volume or restart them.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.