Open brandonkal opened 4 years ago
I'm working around the problem by deleting the entire cluster and starting over. :laughing:
That's exactly what I had to do. Now I'm just templating out of cluster. I'm not sure why the finalizer doesn't run.
In my case, I manage to overcome this by editing the HelmChart
and setting metadata.finalizers
to an empty list (rke2).
Anyone looking at this?
@rasmusson no
I have the same issue and need to patch the finalizers as well. My use-case is on bootstrap of my k3s cluster I have Cilium installed with the k3s HelmChart CR but trying to get the HelmChart to un-manage it after it is installed was quite a task. I want k3s to un-manage Cilium so Flux can take it over.
IMO the last task in this Ansible script should not be needed but it's my workaround for now.
I tried several approaches to work with helm as part of yaml templates an all seem to fail at some point unfortunately
helm template
fails because it does not respect the namespaceThat is pretty bad... I hoped that HelmCharts could finally solve it, but I fear I am back to using helm template and solve the namespace problem myself...
Here a HelmChart example which does not get cleaned up properly:
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: csi-s3
namespace: kube-system
spec:
repo: https://yandex-cloud.github.io/k8s-csi-s3/charts
chart: csi-s3
version: 0.41.1
targetNamespace: kube-system
valuesContent: |-
secret:
create: false
Hi!
Disable helmchart for managed helm-controller (select you variants )
kubectl -n $MY_NS_NAME patch helmchart.helm.cattle.io $MY_HELMCHART_NAME-p '{"metadata":{"annotations":{"helmcharts.helm.cattle.io/unmanaged":"true"}}}' --type=merge
# OR
kubectl annotate --overwrite -f helm.yaml helmcharts.helm.cattle.io/unmanaged='true'
Delete finalizers(select you variants )
kubectl -n $MY_NS_NAME patch helmchart.helm.cattle.io $MY_HELMCHART_NAME -p '{"metadata":{"finalizers":null}}' --type=merge
# OR
kubectl patch -f helm.yaml -p '{"metadata":{"finalizers":null}}' --type=merge
Delete helmchart(select you variants )
kubectl -n $MY_NS_NAME delete --force=true helmchart.helm.cattle.io $MY_HELMCHART_NAME
#OR
kubectl -n $MY_NS_NAME delete --force=true -f helm.yaml
As the title says. I have several charts that just won't delete. kubectl hangs after saying a chart was deleted (but it is not). No job is started to delete the chart.