Orphan resources when an app leaves the ApplicationSet - #73
Open
jacksonloper wants to merge 1 commit into
Open
jacksonloper wants to merge 1 commit into
jacksonloper wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Removing an app's config.json takes its Application out of the set, and ArgoCD then runs resources-finalizer and deletes everything the app owned. For fider-db that chain reaches real data: Application fider-db -> owns postgresql.cnpg.io/Cluster/fider-db Cluster fider-db -> ownerReference on PVC fider-db-1 (controller: true) PVC fider-db-1 -> PV pvc-df9a66c8, reclaim policy Delete Those three links are observed on the live cluster. The cascade is inferred from documented behaviour -- resources-finalizer deletes an Application's managed resources, and Kubernetes garbage collects an object once its controller owner is gone -- rather than from having watched it happen. The Retain policy applied after the August CNPG incident covers pvc-00a3f621, which is Released; the bound volume since the 08-29 rebuild is Delete. This is a different path from `prune`. The note there is correct that prune cannot reach a PVC, since no PVC in this cluster is managed by ArgoCD -- but the finalizer does not prune, it deletes the Cluster, and Kubernetes garbage collects the PVC from the ownerReference. With this set, removing a config.json leaves the resources running and cleanup becomes a deliberate separate act. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MeFy2jujRA8ScQqRAshc1f
jacksonloper
force-pushed
the
JacksonLoper/preserve-resources-on-deletion
branch
from
September 10, 2026 17:57
19bf5d3 to
b80ce4d
Compare
Collaborator
|
Let's discuss this at the next meeting. I think the desired behavior of deleting an app should be to delete the app - we have backups of volumes, so if we need to recover we still can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing an app's
config.jsontakes its Application out of the set. ArgoCD then runsresources-finalizerand deletes everything the app owned. Forfider-dbthat chain reaches the database:Those three links are observed on the live cluster today. The cascade itself is not — nobody has deleted an Application and watched a database die, and this PR exists so nobody has to.
The consequence follows from documented behaviour rather than an experiment: ArgoCD's
resources-finalizerdeletes an Application's managed resources, and Kubernetes garbage-collects an object once itscontroller: trueowner is gone. Standard semantics on both sides, so the confidence is high — but calling it "verified" would overstate it.If you want it settled empirically before merging, the cheap version is a throwaway app owning a throwaway CNPG cluster, deleted with the finalizer in place. That is more work than this PR.
Worth being clear about one thing, because the note on
prunein this file argues the other way and it is correct: prune genuinely cannot reach a PVC, since no PVC in this cluster is managed by ArgoCD. But the finalizer does not prune. It deletes theCluster, and the garbage collector does the rest.The
Retainpolicy applied after the August CNPG incident protectspvc-00a3f621, which isReleased. The volume bound since the 08-29 rebuild ispvc-df9a66c8, and it isDelete.With this set, removing a
config.jsonorphans the resources. They keep running, and cleanup becomes a deliberate separate act.Sequencing
This is step 1 of 6 in moving fider to Flux, and the only one that has to land before anything else:
flux bootstrapapplications/fider{,-db}/config.jsonflux resume kustomization appsStep 5 is held in draft until this merges. That is the whole reason this PR exists separately.
It is also worth having on its own terms. Right now anyone retiring an app —
discord-bot,alaska-rcv, an experiment — destroys its data as a side effect of deleting one small JSON file.starvote/postgresqlis the one that would hurt.🤖 Generated with Claude Code
https://claude.ai/code/session_01MeFy2jujRA8ScQqRAshc1f