cert-manager¶
Issues and renews TLS certificates for every public hostname in the cluster. Every TLS Secret (argocd-server-tls, grafana-tls, auth-tls, the app's tomoda-app-tls) is generated by cert-manager from Let's Encrypt.
Installed by k8s/envs/platform/cert-manager/application.yaml. The ClusterIssuer is defined in k8s/envs/platform/cert-manager/cluster-issuer.yaml.
Chart and source¶
| Field | Value |
|---|---|
| Helm chart | cert-manager |
| Repository | https://charts.jetstack.io |
| Version | v1.21.2 |
crds.enabled |
true (passed as a Helm parameter) |
| Destination namespace | cert-manager (created by Argo CD) |
| Argo CD Application | cert-manager |
crds.enabled: true ships the Certificate, Issuer, ClusterIssuer, CertificateRequest, Order, and Challenge CRDs that the per-app Ingresses depend on. The ClusterIssuer carries SkipDryRunOnMissingResource=true so a fresh-cluster platform sync doesn't abort before the CRDs exist.
ClusterIssuer¶
One issuer, letsencrypt-prod, against the production ACME endpoint (acme-v02.api.letsencrypt.org, account email admin@tomoda.life), with two solvers:
| Solver | Hosts | Why |
|---|---|---|
| DNS-01 (Cloudflare) | tomoda.life, app.tomoda.life, www.tomoda.life, api.tomoda.life |
Proxied prod hosts sit behind the Cloudflare edge, which can redirect an HTTP-01 request on port 80 before it reaches Traefik |
HTTP-01 (Ingress class traefik) |
everything else (dev, Argo CD, Grafana, admin UIs, ...) | Default |
The DNS-01 token is the cloudflare-dns01-token Secret in cert-manager, an ExternalSecret (k8s/envs/platform/manifests/external-secrets-config.yaml) over the same GSM tomoda-cloudflare-api-token External-DNS uses.
- Production endpoint. Certificates and Let's Encrypt rate limits are real (50 certs per registered domain per week, 5 duplicate certs per week). There is no staging issuer, so don't create and delete certs in a loop.
- HTTP-01 depends on Traefik. cert-manager writes a temporary challenge
Ingresswithclass: traefik; if Traefik is down, HTTP-01 hosts can't issue or renew. - No wildcards. Every Ingress that wants TLS lists its exact host(s).
How a workload requests a cert¶
A per-app Ingress declares two things:
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
- hosts:
- argo-app.tomoda.life
secretName: argocd-server-tls
cert-manager's Ingress shim notices the annotation, creates a Certificate resource targeting argocd-server-tls, runs the challenge, and writes the resulting cert+key into argocd-server-tls in the same namespace. Traefik picks the Secret up automatically and serves it for that host.
Concrete examples in this repo:
argocd-server-tlsforargo-app.tomoda.life(k8s/envs/platform/argocd-ingress/ingress.yaml)grafana-tlsforgrafana.tomoda.life(k8s/envs/platform/monitoring/values.yaml)auth-tlsforauth.tomoda.life(k8s/envs/platform/oauth2-proxy/application.yaml)
Auto-renewal¶
cert-manager renews certs roughly 30 days before expiry (Let's Encrypt issues 90-day certs). Renewal uses the same solver as issuance. No human action is required; if a cert shows Ready: False, check the Order and Challenge resources in that namespace.
kubectl get certificate -A
kubectl describe certificate <name> -n <namespace>
kubectl get order,challenge -A
Operational notes¶
- Removing a TLS Secret manually triggers re-issuance. Useful for forcing a refresh, but counts against the rate limit.
- CRDs are installed via the chart, not separately. Uninstalling the cert-manager Application removes the CRDs, every
Certificateand then every TLS Secret in the same sync. Don't do this without a plan.
For the broader TLS story (Cloudflare edge TLS, certificate inventory, what hostnames terminate where), see Security → TLS.