Skip to content

feat(platform): caddyAcme TLS mode — Caddy edge with TLS-ALPN-01 - #11

Open
1456055067 wants to merge 2 commits into
helm-chartfrom
caddy-edge
Open

feat(platform): caddyAcme TLS mode — Caddy edge with TLS-ALPN-01#11
1456055067 wants to merge 2 commits into
helm-chartfrom
caddy-edge

Conversation

@1456055067

Copy link
Copy Markdown
Contributor

Stacked on #10 (base: helm-chart). PR A of the TLS-ALPN-01 + mTLS plan — the edge; backend mTLS follows in PR B.

What

Adds tls.mode: certManager | caddyAcme to the chart. caddyAcme makes Caddy the edge:

  • windep-web runs Caddy instead of nginx — serves the payload tree (file_server), reverse-proxies /api/* to windep-api, and obtains public certs via ACME TLS-ALPN-01 (certmagic).
  • The admin pod gets a Caddy sidecar terminating public TLS on the admin VIP and proxying to admin over localhost.
  • HA: the multi-replica deploy edge shares a certmagic RWX PVC so the anycast TLS-ALPN-01 challenge is served from shared storage on whichever replica it lands.
  • The Go apps (windep-api, admin) run plaintext behind Caddy — no code changes (they already support LISTEN_ADDR without TLS).
  • cert-manager Issuer/Certificates are not rendered in this mode.

certManager (default) is unchanged from #10, so this is additive.

Why Caddy (recap of the design thread)

cert-manager can't do TLS-ALPN-01; per-backend self-issuance breaks under multi-replica anycast (challenge sprays across replicas, Go autocert has no distributed solving). Caddy/certmagic with shared storage is the HA-safe way to run TLS-ALPN-01 here.

Parity / safety

  • windep.dev/lb-anycast labels + both VIP annotations, admin NetworkPolicy (incl. api→admin ingest rule), and api ClusterIP all preserved.
  • Verified helm lint + helm template for both modes and both site value files. Rendered Caddyfiles inspected. Resource counts: certManager 20 (unchanged), caddyAcme 18.

Prereqs for caddyAcme (documented in README)

  • A Caddy image (images.caddy — prefer Iron Bank; verify Repo One availability).
  • Internal-CA-root secret (caddyAcme.caRootSecret, key ca.crt) Caddy trusts for the ACME directory.
  • RWX StorageClass for the shared certmagic PVC.
  • Validate certmagic distributed TLS-ALPN-01 on a real multi-replica cluster.

Not in this PR

Backend mTLS (edge→api/admin, api→admin) — the caddyAcme backend hop is plaintext on the pod network today. App-level mTLS in the Go services is PR B (Go source + cert-manager CA issuer + image bumps), per the approved plan.

Diagram: platform/docs/caddy-tls-alpn.drawio.

Add tls.mode: certManager | caddyAcme. caddyAcme makes Caddy the edge:
windep-web runs Caddy (instead of nginx) and the admin pod gets a Caddy
sidecar. Caddy obtains public certs via ACME TLS-ALPN-01 (certmagic, HA
across the deploy replicas via a shared RWX PVC) against the internal ACME
CA, serves the payload tree, and reverse-proxies to the Go apps, which run
plaintext behind it. cert-manager is not rendered in this mode.

- New: images.caddy, caddyAcme.* values; web Caddy deployment + Caddyfile
  ConfigMap + certmagic RWX PVC; admin Caddy sidecar + Caddyfile; api/admin
  run plaintext (LISTEN_ADDR/no TLS env) in caddyAcme.
- Existing certManager path unchanged (default); mode-gated templates.
- Parity preserved: anycast labels + both VIPs, admin NetworkPolicy, api
  ClusterIP. Verified helm lint + template for both modes / both site values.
- Docs: platform/README.md TLS-modes section; platform/docs/caddy-tls-alpn.drawio.

Backend mTLS (edge->api/admin, api->admin) is a follow-up (app-level mTLS in
the Go services); the caddyAcme backend hop is plaintext for now.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant