Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Know it before you install
An Issuer (one namespace) or ClusterIssuer (whole cluster) says how to get certificates. A Certificate says what you want (DNS names, secret name). cert-manager creates a CertificateRequest → Order → Challenge (for ACME) and finally a Secret of type kubernetes.io/tls.
| Item | Value |
|---|---|
| Install | Helm chart jetstack/cert-manager (or oci://quay.io/jetstack/charts/cert-manager) |
| Namespace | cert-manager (controller, webhook, cainjector) |
| CRDs | Certificate, Issuer, ClusterIssuer, CertificateRequest, Order, Challenge |
| CLI | cmctl (optional) |
| Output | a TLS Secret (tls.crt, tls.key) in the app namespace |
What you need: a Kubernetes cluster, Helm, an ingress controller or Gateway that is reachable on port 80 from the internet (for HTTP-01), or API access to your DNS (for DNS-01).
Install with Helm
Pin the version (see the cert-manager releases):
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm upgrade --install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.19.1 --set crds.enabled=true --set prometheus.enabled=true --wait
kubectl -n cert-manager get pods
cert-manager-6d… 1/1 Running
cert-manager-cainjector-5f… 1/1 Running
cert-manager-webhook-7b… 1/1 Runningcrds.enabled=true installs the CRDs with the chart. Keep the version pinned and upgrade on purpose.
First configuration: Let's Encrypt issuers
Always start with staging (no rate limits), then switch to production:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: ops@example.com
privateKeySecretRef:
name: letsencrypt-staging-account
solvers:
- http01:
ingress:
ingressClassName: nginx
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: ops@example.com
privateKeySecretRef:
name: letsencrypt-prod-account
solvers:
- http01:
ingress:
ingressClassName: nginxkubectl apply -f cluster-issuers.yaml
kubectl get clusterissuer
NAME READY
letsencrypt-staging True
letsencrypt-prod TrueFor wildcards or clusters that are not public, use DNS-01. Example with Cloudflare (an API token that may only edit DNS of that zone):
kubectl -n cert-manager create secret generic cloudflare-api-token --from-literal=api-token='CF_TOKEN_HERE' solvers:
- dns01:
cloudflare:
apiTokenSecretRef:
name: cloudflare-api-token
key: api-token
selector:
dnsZones: ["example.com"](Add this solver to a ClusterIssuer's solvers list. Route 53, Azure DNS, Google Cloud DNS and others work the same way — best with workload identity instead of keys.)
Get certificates
The easy way — an annotation on the Ingress; cert-manager makes the Certificate for you:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: shop
namespace: shop
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: nginx
tls:
- hosts: [shop.example.com]
secretName: shop-tls
rules:
- host: shop.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service: { name: shop, port: { number: 80 } }Or an explicit Certificate (also for a Gateway listener, or any app that reads a TLS secret):
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard-example
namespace: gateway
spec:
secretName: wildcard-example-tls
dnsNames: ["example.com", "*.example.com"]
issuerRef:
kind: ClusterIssuer
name: letsencrypt-prod
privateKey:
algorithm: ECDSA
size: 256
rotationPolicy: Alwayskubectl apply -f certificate.yaml
kubectl -n gateway get certificate
NAME READY SECRET AGE
wildcard-example True wildcard-example-tls 2mcert-manager renews 30 days (one third of the lifetime) before expiry by default.
Daily use: check and debug
When a certificate is not READY, follow the chain down:
kubectl get certificate,certificaterequest,order,challenge -A
kubectl -n shop describe certificate shop-tls
kubectl -n shop describe order shop-tls-1-123456
kubectl -n shop describe challenge shop-tls-1-123456-789
kubectl -n cert-manager logs deploy/cert-manager --tail 50
cmctl status certificate shop-tls -n shop
cmctl renew shop-tls -n shop
kubectl -n shop get secret shop-tls -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -subject -enddateReal uses at work:
- HTTPS for every Ingress/Gateway without manual work.
- An internal CA (
CAorVaultissuer) for mTLS between services. - Wildcard certificates with DNS-01 for many subdomains.
Make it safe
Security checklist:
- Test with the staging issuer first (Let's Encrypt rate limits).
- DNS API tokens with the smallest scope (one zone, DNS edit), or workload identity.
- RBAC: only platform admins may create/modify ClusterIssuers.
rotationPolicy: Alwaysfor new private keys at every renewal.- Monitor expiry (cert-manager Prometheus metrics
certmanager_certificate_expiration_timestamp_seconds) and alert. - Keep cert-manager updated; its webhook must stay reachable from the API server.
Update and remove
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
Challenge pending: Waiting for HTTP-01 challenge propagation: … 404 | The challenge URL is not reachable from the internet on port 80. | DNS must point to the ingress; open port 80; check the ingressClassName in the solver. |
Challenge pending with DNS-01 | Wrong token rights or wrong zone. | describe challenge; check the token and dnsZones. |
Order errored: rateLimited | Too many certificates for the domain. | Wait; use staging for tests. |
Internal error occurred: failed calling webhook "webhook.cert-manager.io" | The API server can not reach the webhook (firewall, private clusters). | Allow the control plane to reach the webhook port (often 10250); check the webhook Pod. |
Issuer not Ready | Wrong ACME URL or account secret. | kubectl describe clusterissuer; check the email and server URL. |
| Browser shows a "Fake LE" certificate | You used the staging issuer. | Change to letsencrypt-prod; delete the old secret so a new one is issued. |
Next steps
- Quick how-to: Expose an app with an Ingress and TLS.
- Learn it for the exams: CKA — Add TLS to an Ingress, CKS — Protect the ingress with TLS.
- Outside Kubernetes: Certbot. Install charts: Helm.
- The traffic side: ingress-nginx and Gateway API.
1Which objects does cert-manager create on the way to a certificate?
CertificateRequest → Order → Challenge, and finally the TLS Secret.
2Why start with the Let's Encrypt staging issuer?
Staging has no strict rate limits, so mistakes do not block your domain.