← 输入框|github.com|刷新
Skip to content

docs: explain how to rotate the database password - #7792

Merged
jyotshnayaparla-00 merged 2 commits into
mainfrom
docs/rotate-db-password
Nov 3, 2026
Merged

jyotshnayaparla-00 merged 2 commits into
mainfrom
docs/rotate-db-password

Conversation

@jyotshnayaparla-00

Copy link
Copy Markdown
Contributor

This adds a "Rotate the database password" section to helm-guide.md. It also covers what to do if the ALTER ROLE step fails, and what to do for an external database.

Tested the ALTER ROLE steps on postgres:16.0 and the kubectl create secret command with a dry run. I didn't test the full flow on a Helm install.

@jyotshnayaparla-00 jyotshnayaparla-00 self-assigned this Nov 2, 2026
@jyotshnayaparla-00
jyotshnayaparla-00 requested a review from gz November 2, 2026 21:31
Comment on lines +265 to +267
If step 2 fails, nothing has changed yet, and the components still use the old
password. If you use an external database, change the password there, update
`.connection_url` in the secret, and do step 4.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing (medium): this explains how to recover when step 2 fails, but not when step 3 or 4 fails or stalls (e.g. a pod stuck in CrashLoopBackOff with auth errors). Step 3 overwrites the old password, so there is no rollback path. Suggest saving it before step 2 (OLD_PASSWORD=$(kubectl get secret ... -o jsonpath='{.data.\.password}' | base64 -d)) and documenting the rollback: run ALTER ROLE back to the old password, then re-apply the old secret.

@mythical-fred-oss

Copy link
Copy Markdown
Contributor

Docs-only PR (Helm guide: rotate the database password).

What I ran

Check Result
pre-commit run --files helm-guide.md pass
kubectl create secret ... --dry-run=client -o yaml (step 3) produces the .user/.password data keys the chart expects
Password generator + printf SQL in step 1/2 32 alphanumeric chars, valid statement
Resource names (feldera-db-0, feldera-api-server, feldera-kubernetes-runner, statefulset/feldera-compiler-server, feldera-compiler-artifact-server) match the rest of this guide and parallel-compilation.md
ALTER ROLE over the local socket not run (no Postgres here). The author ran it on postgres:16.0

Gates: no behaviour change, so the test gates don't apply. The commit message is good. The full flow wasn't tested on a Helm install, as the description says.

Not covered yet (details inline): how to roll back if step 3 or 4 fails, and cases where the old secret value comes back (GitOps re-apply, ESO refresh delay, the chart-owned insecure default secret). Otherwise LGTM.


### Rotate the database password

You can change the password of the bundled database without losing any data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would hope so

kubectl exec -i -n feldera feldera-db-0 -- sh -c 'psql -U "$POSTGRES_USER" -d postgres -v ON_ERROR_STOP=1'
```
It should print `ALTER ROLE`. From now on, new connections with the old password
fail. Connections that are already open stay up, so continue with the next steps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fail. Connections that are already open stay up, so continue with the next steps
fail. Connections that are already open continue to work, so do the next steps


If step 2 fails, nothing has changed yet, and the components still use the old
password. If you use an external database, change the password there, update
`.connection_url` in the secret, and do step 4.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`.connection_url` in the secret, and do step 4.
`.connection_url` in the secret, and proceed to step 4.

Changing the database secret alone does not change the password of an
existing Postgres volume, and the Feldera components only read it at
startup. Describe how to rotate it with ALTER ROLE without data loss.
@jyotshnayaparla-00
jyotshnayaparla-00 added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit d0a8a12 Nov 3, 2026
1 check passed
@jyotshnayaparla-00
jyotshnayaparla-00 deleted the docs/rotate-db-password branch November 3, 2026 17:15
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