mirror of
https://github.com/certctl-io/certctl.git
synced 2026-09-02 10:31:25 +02:00
fix(helm): DEPL-003 + DEPL-006 — render viaHook env, sessionAffinity, HA backend default
Sprint 3 unified-master-audit closure — two Helm-chart correctness
defects with overlapping CI-guard surface.
DEPL-003 — CERTCTL_MIGRATIONS_VIA_HOOK never rendered:
Pre-fix the env var was documented in values.yaml and the
migration-job.yaml comment but never made it into the server
Deployment env block. With migrations.viaHook=true the operator's
intent is 'the pre-install/pre-upgrade Helm Job owns migrations,'
but the server pods, missing the env, ran their own
cmd/server/migrations.go::runBootMigrations alongside the hook
Job, racing on the schema lock.
Fix: render '- name: CERTCTL_MIGRATIONS_VIA_HOOK / value: true'
in server-deployment.yaml under '{{- if .Values.migrations.viaHook }}'.
DEPL-006 — HA example missing rate-limit backend + sessionAffinity:
values-prod-ha.yaml sets replicas:3 but inherited the chart-wide
default rateLimiting.backend=memory (which gives each pod its
own bucket map, effectively tripling the cap on a 3-replica fleet)
AND the chart had no render path for server.service.sessionAffinity
even though docs/operator/runbooks/ha.md instructed operators to
set it for ClientIP-routed sticky sessions.
Fix:
- server-service.yaml gains a conditional sessionAffinity +
sessionAffinityConfig.clientIP.timeoutSeconds render.
- values.yaml grows the matching schema entries (default empty
so single-replica deploys are unaffected).
- values-prod-ha.yaml flips rateLimiting.backend=postgres and
service.sessionAffinity=ClientIP.
- NOTES.txt emits a loud warning when replicas>1 + either toggle
is still in the default state, so the misconfig surfaces at
helm install time instead of in a confused login-flow bug
report a week later.
CI:
scripts/ci-guards/B3-helm-chart-coherence.sh gains 'Check 7'
(DEPL-003 viaHook env render — both positive and negative —
the inverse case catches future drift that drops the {{- if }}
guard) and 'Check 8' (DEPL-006 sessionAffinity render). Both
helm-template through to assert the rendered YAML carries the
expected text.
Closes DEPL-003, DEPL-006.
This commit is contained in:
@@ -160,6 +160,17 @@ server:
|
||||
type: ClusterIP
|
||||
port: 8443
|
||||
annotations: {}
|
||||
# DEPL-006 closure (Sprint 3, 2026-05-16). Optional sticky-session
|
||||
# routing. REQUIRED when server.replicas > 1 so login + CSRF token
|
||||
# rows stay on the same pod for the duration of a session — the
|
||||
# default round-robin load balancing breaks those flows. Set to
|
||||
# "ClientIP" for production HA (see deploy/helm/examples/values-prod-ha.yaml).
|
||||
# Leave empty for single-replica deploys.
|
||||
sessionAffinity: ""
|
||||
# When sessionAffinity is set, timeout window (in seconds) the
|
||||
# Service maps a source IP to the same pod. Default null →
|
||||
# Kubernetes applies its built-in default (10800s / 3h).
|
||||
sessionAffinityTimeoutSeconds: null
|
||||
|
||||
# Authentication configuration.
|
||||
# Valid types: "api-key" (production) or "none" (demo only — disables
|
||||
|
||||
Reference in New Issue
Block a user