mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-07 13:51:36 +00: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:
@@ -36,6 +36,14 @@ server:
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
# DEPL-006 closure (Sprint 3, 2026-05-16): with replicas:3, the
|
||||
# default round-robin Service load balancing breaks login/CSRF
|
||||
# flows because the session cookie + the CSRF token row land on
|
||||
# different pods between requests. sessionAffinity: ClientIP
|
||||
# routes every connection from a given source IP to the same
|
||||
# pod for the configured timeout window. docs/operator/runbooks/ha.md
|
||||
# documents this; pre-fix the chart did not actually render it.
|
||||
sessionAffinity: ClientIP
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "8443"
|
||||
@@ -53,6 +61,14 @@ server:
|
||||
rateLimiting:
|
||||
rps: 500
|
||||
burst: 1000
|
||||
# DEPL-006 closure (Sprint 3, 2026-05-16): replicas > 1 REQUIRES
|
||||
# the postgres backend so per-key buckets are cross-replica-
|
||||
# consistent. The default 'memory' backend gives each pod its
|
||||
# own bucket map, so a 3-replica fleet effectively triples the
|
||||
# configured cap (a client churning across pods bypasses the
|
||||
# limit). See deploy/helm/certctl/values.yaml L217-226 for the
|
||||
# canonical comment.
|
||||
backend: postgres
|
||||
|
||||
postgresql:
|
||||
enabled: true
|
||||
|
||||
Reference in New Issue
Block a user