Commit 53ac201
fix(infrastructure): delete application db PVC on instance teardown (#356)
The application template's Postgres StatefulSet left its data PVC behind when
an Application was deleted, so recreating with the same name failed with
"password authentication failed for user appuser": the pwgen Job minted a
fresh password into the new credentials Secret while Postgres recovered the
orphaned volume (old password).
The PVC is created by the StatefulSet controller from volumeClaimTemplates,
not by kro, so it has no kro labels and isn't in kro's applyset — kro never
GCs it. And the StatefulSet's default persistentVolumeClaimRetentionPolicy
(whenDeleted: Retain) keeps it across a StatefulSet delete. So nothing cleaned
it up.
Set whenDeleted: Delete so the PVC's lifecycle follows the StatefulSet kro
deletes on teardown; a same-name recreate then starts from a fresh database.
whenScaled stays Retain (no horizontal scaling here anyway).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent f1f6b05 commit 53ac201
1 file changed
Lines changed: 12 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
314 | 326 | | |
315 | 327 | | |
316 | 328 | | |
| |||
0 commit comments