-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Namespace deletion hanging #135
Comments
The Helmchart resource should be in the kube-system namespace, as otherwise the finalizers hang.
To release the broken HelmChart resource in the wrong namespace you can manually patch the finalizers on the HelmChart resource. This will release the namespace:
to:
|
@cubinet-code Thank you so much, I really appreciate your answer, this solves a lot of things in our company. |
What needs to be done, so we can deploy a Kind HelmChart in other namespaces than kube-system? |
I have the same problem. We implement HelmChart to the same namespace on which we implement Helm Charts. This makes it easier to deploy using the GitOps method with Anthos Config Manager. Does it say somewhere in the documentation that you have to apply HelmChart to There is a script for fast patching: namespace=hanging-namespace
kubectl --namespace="$namespace" get helmchart --output=name \
| xargs -rI{} kubectl patch --namespace="$namespace" {} --type=merge --patch='{"metadata": {"finalizers": []}}' |
There is no requirement that you deploy charts to any particular namespace. I'm not sure why the finalizer would be getting stuck when deploying to different namespaces. |
@brandond I checked what the issue might be. I created a namespace
Then I started namespace
I then wanted to delete the entire namespace
I applied the patch from my previous post, then the namespace was removed. For further testing I reinstalled namespace
And finally, I removed the namespace with the
It seems that before deleting namespace you must first delete HelmChart resources, although despite this order Helm Controller still doesn't quite get it right. |
The problem is not having the HelmChart in another namespace, the problem is deleting HelmChart resources implicitly by deleting the namespace that contains them. In that case the controller tries to uninstall the helm release, but it can't create the job (or something else it needs; I didn't check the exact sequence of events) to do it, because the namespace is in Terminating state and nothing can be created in it. In the common case not uninstalling with helm won't matter, because the resources will also be deleted with the namespace, but in case helm installed some non-namespaced resources or installed resources explicitly in other namespaces, they will remain, so this is not ideal. Unfortunately helm does not force annotating the resources it creates in any way, so they can't be deleted without running helm. So simply ignoring the error if the namespace is in Terminating state is the only thing the controller could do to avoid this issue. |
Hello all.
I'm experiencing namespace termination hang when using helmchart.helm.cattle.io CRD.
I'm Applying the following helm resource:
this file creates the resource and works perfectly fine but the problem arise when trying to delete the namespace.
K3s version
What should be the exact behavior?
Is there any documentation related to the CRD and the deletion process?
Any help here will be appreciated.
The text was updated successfully, but these errors were encountered: