Repository navigation
docs: explain how to rotate the database password - #7792
Conversation
| 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. |
There was a problem hiding this comment.
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.
|
Docs-only PR (Helm guide: rotate the database password). What I ran
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. |
| 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 |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
| `.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.
7b690e6 to
fddd417
Compare
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.