Delete behaviour #4931
-
Hello, Im a bit confused and also not able to figure out from the docs on how deletion should work. I found that you need to add prune: true to kustomization in order to have the deployed resources deleted after the kustomization itself is deleted. Now what the questions are:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you delete a bootstrap Kustomization (one that has no parent Kustomization), then Flux will have no way to re-create it. If you delete a Kustomization that has been created by another Kustomization (or a Helm release), it will be re-created the next time the GitRepository resource is reconciled. |
Beta Was this translation helpful? Give feedback.
If you want a resource to be deleted from the cluster but keep it in Git, you have several options, depending on how Flux managed the resource. If you have a
kustomization.yaml
in your Git repo, just remove the resource file from theresources
field. If your Kustomization's.spec.prune
field is set toprune
, the resource will be removed from the cluster but you'll still have it in Git.