TLS manuale è rotto
In Kubernetes, gestire certificati TLS manualmente è impraticabile: decine di Ingress, hostname diversi, scadenze, rinnovi, multi-tenant. Gli operatori vogliono un flusso dichiarativo: aggiungi un’annotazione o CRD, il cluster ottiene e rinnova il certificato.
Il rilascio
cert-manager viene pubblicato da Jetstack (UK, acquisita da Venafi nel 2020) nel marzo 2017. Lead: James Munnelly. Scritto in Go, licenza Apache 2.0. Donato alla CNCF nel 2020, incubating dal 2022, graduated il 12 novembre 2024 (KubeCon NA Salt Lake City).
Come funziona
Tre CRD fondamentali:
- Issuer / ClusterIssuer — definisce un’autorità (Let’s Encrypt, Vault, CA privata, Venafi TPP/TLSPDC)
- Certificate — richiesta di certificato per uno o più DNS SAN
- CertificateRequest / Order / Challenge — flusso interno ACME
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata: { name: letsencrypt-prod }
spec:
acme:
email: ops@example.com
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef: { name: le-prod-key }
solvers:
- http01: { ingress: { class: nginx } }
Sui Ingress basta l’annotazione cert-manager.io/cluster-issuer: letsencrypt-prod e cert-manager emette/rinnova certificati automaticamente in Secret TLS.
Feature
- ACME HTTP-01 e DNS-01 — DNS-01 richiesto per wildcard
- Provider DNS 50+ (Route53, Cloudflare, Azure DNS, GCP, OVH, DigitalOcean, etc.)
- Vault issuer — PKI HashiCorp Vault
- Venafi — enterprise CA
- Self-signed / CA — CA interne
- Renewal automatic — entro window configurabile
- mTLS — per Istio, Linkerd integration
Integrazione ecosystem
- Ingress NGINX, Traefik, Contour, HAProxy Ingress
- Istio (gateway), Linkerd (mTLS)
- Gateway API (K8s native, GA 2023)
- External DNS — combinazione per auto-DNS + TLS
- ArgoCD/Flux — gestione dichiarativa con GitOps
Alternative
- Traefik ACME — built-in in Traefik, meno features
- Caddy — auto-HTTPS, ma fuori da K8s native
- kube-lego — predecessore, deprecato
- EKS ACM, GKE Managed Certs — cloud-specific
Nel contesto italiano
cert-manager è de facto standard per TLS Kubernetes nelle aziende italiane:
- SaaS B2B multi-tenant con wildcard Let’s Encrypt DNS-01
- Banche con CA interne (Vault issuer)
- PA digitale con certificati emessi da AgID-CAs
- MSP che gestiscono K8s per clienti
- Hosting provider italiani con Kubernetes-as-a-Service
L’utilizzo di Let’s Encrypt DNS-01 via cert-manager è quasi ubiquo dove c’è K8s in prod.
Riferimenti: cert-manager (Jetstack, marzo 2017). James Munnelly. Licenza Apache 2.0. Venafi owner dal 2020. CNCF graduated (12 novembre 2024, KubeCon NA). ACME, Vault, Venafi, CA private issuer. Wildcard DNS-01 support.
