k3s-io / helm-controller

Apache License 2.0
389 stars 84 forks source link

Cannot delete charts #33

Open brandonkal opened 4 years ago

brandonkal commented 4 years ago

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.

jdmarble commented 4 years ago

I'm working around the problem by deleting the entire cluster and starting over. :laughing:

brandonkal commented 4 years ago

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.

zifeo commented 2 years ago

In my case, I manage to overcome this by editing the HelmChart and setting metadata.finalizers to an empty list (rke2).

rasmusson commented 1 year ago

Anyone looking at this?

cornfeedhobo commented 12 months ago

@rasmusson no

onedr0p commented 9 months ago

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.

schlichtanders commented 3 months ago

I tried several approaches to work with helm as part of yaml templates an all seem to fail at some point unfortunately

That 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...

schlichtanders commented 3 months ago

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
sergey-kudriavtsev commented 6 days ago

Hi!

Here is a link to the solution description for RKE2

Delete frozen resource

  1. 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'
  2. 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
  3. 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