I have an app which I'm deploying with Helm. Once deployed, the app itself sometimes creates other Kubernetes resources (like Deployments
and Services
) in the same namespace as the app. When I run helm delete
on the Helm release, it deletes all the resources originally created by Helm, but it leaves the resources that were created by the app. I would like to clean up these resources as well and I'm wondering if I can make Helm do so automatically.
I've tried applying the recommended labels from here such as app.kubernetes.io/managed-by
and app.kubernetes.io/instance
to my new resources, but Helm still doesn't delete them.
I also looked in the Helm manual but I can't find any clarity about how Helm decides what resources it "owns" and can delete.
(I know that I can use a Helm pre-delete
or post-delete
hook for this, but it feels cleaner to get Helm's normal deletion process to do this.)