Skip to content

feat(ingress): --certs-out-secret to auto-wire TLS certs from Ingress#44

Merged
pigri merged 1 commit into
mainfrom
feat/certs-out-secret
Jun 20, 2026
Merged

feat(ingress): --certs-out-secret to auto-wire TLS certs from Ingress#44
pigri merged 1 commit into
mainfrom
feat/certs-out-secret

Conversation

@pigri

@pigri pigri commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Problem

The ingress controller projects Ingress/Gateway TLS Secrets into synapse's certificates dir — but only via --certs-out (a local dir, sidecar mode). In the central topology used in prod (separate operator pod + --upstreams-out-configmap), there's no way to deliver certs to the separate proxy pod. So the proxy needs a hand-maintained projected-volume list of cert Secrets in its Helm values (each new host = manual edit), even though routing (upstreams) is already fully operator-generated.

Fix

Add --certs-out-secret namespace/name — the central-mode analogue of --upstreams-out-configmap:

  • The controller projects each referenced TLS Secret into this Secret as <stem>.crt/<stem>.key data keys.
  • The separate synapse-proxy pod mounts this Secret as its certificates dir → certs are operator-owned, auto-wired from Ingress spec.tls.
  • Data is replaced on every changed render (stale certs pruned); rotation re-projects via the existing TLS-Secret watch (now armed for this mode too).
  • Missing / non-TLS source Secrets are skipped softly (logged + metric), as in dir mode.
  • Secrets RBAC gains create;update;patch (kubebuilder marker + config/rbac.yaml).

Precedence: --certs-out-secret takes priority over --certs-out.

Test

TestProjectCertsToSecret (create/idempotent/rotation/prune/missing-secret/disabled-no-op). go build, vet, gofmt, full go test ./... green.

Follow-ups (separate)

  • Helm: set --certs-out-secret on the ingress operator + point the proxy's tls-certs volume at the operator-owned Secret (drops the manual projection). Operator ClusterRole secrets verbs updated in helm-charts.

https://claude.ai/code/session_01UdGcTcZj5FU9cUXEdhr81T

The ingress controller could already project Ingress/Gateway TLS Secrets,
but only into a local dir (--certs-out, sidecar mode). In the central
topology (separate operator pod, --upstreams-out-configmap), there was no
way to deliver certs to the proxy — so the proxy needed a hand-maintained
projected-volume list of cert Secrets in its Helm values.

Add --certs-out-secret (namespace/name): the central-mode analogue of
--upstreams-out-configmap. The controller projects each referenced TLS
Secret into this Secret as <stem>.crt/<stem>.key data keys; the separate
synapse-proxy pod mounts it as its certificates dir, so certs are
operator-owned and auto-wired from Ingress TLS. Data is replaced each
changed render (stale certs pruned); rotation re-projects on the existing
TLS Secret watch. Secrets RBAC gains create/update/patch.

Closes the manual cert-projection gap (parity with operator-generated
upstreams).

Claude-Session: https://claude.ai/code/session_01UdGcTcZj5FU9cUXEdhr81T
@pigri pigri merged commit 9e65944 into main Jun 20, 2026
6 checks passed
@pigri pigri deleted the feat/certs-out-secret branch June 20, 2026 12:36
pigri added a commit to gen0sec/helm-charts that referenced this pull request Jun 20, 2026
The ingress controller's new central-mode cert projection
(--certs-out-secret) writes the operator-owned cert Secret that the
synapse-proxy pod mounts. Grant the operator ClusterRole
create/update/patch on secrets (was read-only). Backward-compatible;
unused until --certs-out-secret is set. Chart 1.4.0 -> 1.4.1.

Pairs with gen0sec/synapse-operator#44.

Claude-Session: https://claude.ai/code/session_01UdGcTcZj5FU9cUXEdhr81T
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