2.9 KiB
2.9 KiB
cert-manager Architecture
This document records the complete certificate control-plane contract for the svc.plus platform.
Scope
The system is split into four distinct responsibilities:
cert-managerowns certificate issuance, renewal, and the targetSecretobjects.Caddyremains the ingress surface and serves HTTP-01 challenge traffic.external-dnsonly manages DNS records for public hostnames.external-secretscontinues to materialize Vault-sourced application secrets, AK/SK pairs, future provider credentials such as the Cloudflare API token, and image pull secrets.
Default Contract
postgresql-prod.svc.plusdefaults tocert-manager + ACME HTTP-01.DNS-01 + Cloudflareis predeclared for wildcard certificates and future subdomains.selfSignedremains available as an internal temporary or recovery fallback.cert-managerownspostgresql-tlsin every namespace that consumes it, so there is no cross-namespace Secret sync job.
System Diagram
flowchart LR
Vault[(Vault)]
ESO[external-secrets]
CloudflareToken[(cloudflare-api-token Secret)]
ExternalDNS[external-dns]
DNSZone[(svc.plus DNS zone)]
Caddy[Caddy Ingress]
CertMgr[cert-manager]
Http01["ACME HTTP-01"]
Dns01["ACME DNS-01 + Cloudflare"]
SelfSigned["selfSigned fallback"]
PlatformCert["platform/postgresql-tls Certificate"]
PlatformSecret["platform/postgresql-tls Secret"]
DatabaseCert["database/postgresql-tls Certificate"]
DatabaseSecret["database/postgresql-tls Secret"]
PostgreSQL["postgresql-prod.svc.plus"]
Stunnel["database/stunnel-server"]
Vault --> ESO
ESO --> CloudflareToken
CloudflareToken --> Dns01
ExternalDNS --> DNSZone
DNSZone --> Caddy
Caddy --> Http01
Http01 --> CertMgr
Dns01 --> CertMgr
SelfSigned -. fallback .-> CertMgr
CertMgr --> PlatformCert
CertMgr --> DatabaseCert
PlatformCert --> PlatformSecret
DatabaseCert --> DatabaseSecret
PlatformSecret --> Caddy
DatabaseSecret --> Stunnel
Caddy --> PostgreSQL
Operational Rules
- Keep
cert-manageras the source of truth for TLS Secret ownership. - Keep
Caddyas the traffic and HTTP-01 routing layer only. - Keep
external-dnsfocused on DNS record reconciliation. - Keep
external-secretsfocused on external secret materialization. - Treat the Cloudflare API token as an external input secret; it can be bootstrapped manually or delivered by
external-secretswhen that path is wired in. - Prefer namespace-local
Certificateobjects for each consumer namespace. - Avoid cross-namespace certificate copying or Secret sync controllers.
Related Playbook Roles
vhosts/k3s_platform_bootstrap- installs the platform node and prepares GitOps handoff
vhosts/k3s_platform_addon- installs shared platform services such as
cert-manager,external-secrets,caddy, andexternal-dns
- installs shared platform services such as
GitOps- owns the namespace-local
Certificatemanifests and workload wiring
- owns the namespace-local