Skip to content

fix(chart): roll dploy pod when secrets change - #44

Open
AYDEV-FR wants to merge 1 commit into
feat/oidc-scopesfrom
fix/dploy-secret-checksum-roll
Open

fix(chart): roll dploy pod when secrets change#44
AYDEV-FR wants to merge 1 commit into
feat/oidc-scopesfrom
fix/dploy-secret-checksum-roll

Conversation

@AYDEV-FR

Copy link
Copy Markdown
Owner

Problem

dploy reads OIDC_CLIENT_SECRET (and JWKS_URL / JWT_ISSUER / issuer values) from the chart-managed *-secrets Secret as environment variables, injected once at container start.

When Helm updates that Secret — e.g. rotating the OIDC client_secret — the Deployment's pod template is unchanged, so Kubernetes does not roll the pod. The running process keeps the old secret and dploy fails the CTFd token exchange with:

invalid_client: "The client cannot authenticate with methods: ['client_secret_basic', 'client_secret_post', 'none']"

…silently, until someone runs kubectl rollout restart deploy/dploy. Hit this in practice while rotating the dploy↔CTFd OIDC secret.

Fix

Add a checksum/secret pod annotation that hashes the rendered secret.yaml, so any change to its values rolls the pod automatically (standard Helm pattern). Verified with helm template:

  • annotation renders to a hash and merges cleanly with podAnnotations
  • the hash changes when auth.oidcClientSecret changes → pod rolls

No behavioural change when secrets are unchanged.

dploy reads OIDC_CLIENT_SECRET and the JWKS/issuer values from the
chart-managed Secret as environment variables, which are injected once
at container start. When Helm updates the Secret (e.g. rotating the OIDC
client_secret) the Deployment pod template is unchanged, so Kubernetes
never rolls the pod and the running process keeps the stale secret —
silently breaking CTFd SSO with "invalid_client" at the token endpoint
until a manual `kubectl rollout restart`.

Add a checksum/secret pod annotation hashing the rendered Secret so any
value change triggers a rollout automatically.
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.

2 participants