TLS¶
How certificates are issued, renewed, and consumed across the platform.
In-cluster hosts: cert-manager + Let's Encrypt¶
Every Ingress opts in with cert-manager.io/cluster-issuer: "letsencrypt-prod", and cert-manager fills the Secret named in spec.tls.secretName. The single ClusterIssuer (k8s/envs/platform/cert-manager/cluster-issuer.yaml) has two solvers:
- DNS-01 via Cloudflare for the proxied prod app hosts (
tomoda.life,app,www,api), whose HTTP-01 challenge could be redirected at the edge before reaching Traefik. Token:cert-manager/cloudflare-dns01-token, fromtomoda-cloudflare-api-token. - HTTP-01 via Traefik for everything else.
Chart, version and troubleshooting live on cert-manager.
| Hosts | TLS Secret (namespace) |
|---|---|
api.tomoda.life, tomoda.life, app.tomoda.life, www.tomoda.life |
tomoda-app-tls (tomoda-prod) |
api-dev.tomoda.life, app-dev.tomoda.life |
tomoda-app-tls (tomoda-dev) |
ota.tomoda.life / ota-dev.tomoda.life |
xavia-ota-{prod,dev}-tls (platform) |
argo-app.tomoda.life |
argocd-server-tls (argocd) |
grafana.tomoda.life |
grafana-tls (monitoring) |
auth.tomoda.life |
auth-tls (sys) |
pg-admin-{dev,prod}.tomoda.life |
pgadmin-{dev,prod}-tls |
redis-{dev,prod}.tomoda.life |
redisinsight-{dev,prod}-tls |
cert-manager issues one multi-SAN certificate per Ingress and renews it 30 days before expiry.
kubectl get certificate -A # READY=True
kubectl describe certificate tomoda-app-tls -n tomoda-prod
kubectl get events -n tomoda-prod --field-selector involvedObject.kind=Certificate
kubectl describe challenge -n tomoda-prod # stuck issuance
# Force a new certificate now
kubectl delete certificate tomoda-app-tls -n tomoda-prod # re-created from the Ingress annotation
Cloudflare edge¶
Zone TLS settings are Terraform (infrastructure/cloudflare/zone_settings.tf):
| Setting | Value |
|---|---|
| SSL mode | strict |
| Minimum TLS version | 1.2 |
| TLS 1.3 | on |
| Always Use HTTPS | on |
| Automatic HTTPS Rewrites | on |
| Authenticated Origin Pulls | on (origin_pulls.tf) |
Strict origin validation. Cloudflare connects to every proxied origin over TLS and requires a certificate that is unexpired, issued by a public CA (or the Cloudflare Origin CA), and covers the requested hostname. The proxied origin hosts (tomoda.life, app, www, api, api-dev, app-dev) all serve the cert-manager Let's Encrypt certificates above. An origin that serves Traefik's default self-signed certificate or a cert missing the hostname returns a 526 at the edge.
Cloudflare issues and renews the edge certificates for Worker, Pages, R2 and Tunnel hostnames (assets[-dev], docs, photon-index, loki-push); nothing in the cluster is involved.
Prod origin lock. Prod api/app hosts are proxied, and Traefik's TLSOption (k8s/apps/tomoda/overlays/prod/cloudflare-aop.yaml) requires Cloudflare's origin-pull client certificate on them, so the origin rejects TLS that did not come through the edge. Turn AOP on at Cloudflare before enforcing it at Traefik, or every prod request fails TLS. Dev hosts are proxied without AOP.
New hosts. A new proxied host needs a valid certificate before it is proxied, or the edge returns 526. On HTTP-01 the first challenge may also fail at the edge. Use DNS-only until the first certificate issues (kubectl get certificate -A shows READY=True), or add the host to the DNS-01 selector.
Trust chain¶
Browser
|
v
api.tomoda.life --(edge TLS)--> Cloudflare --(verified Let's Encrypt + AOP mTLS)--> Traefik --> backend (HTTP)
tomoda.life --(edge TLS)--> Cloudflare --(verified Let's Encrypt + AOP mTLS)--> Traefik --> frontend (HTTP)
assets.tomoda.life --(edge TLS)--> assets Worker --> R2 (binding)
Traefik to pod traffic is plain HTTP inside the cluster network; pod-to-pod mTLS would be a service-mesh decision and is out of scope.