Skip to content

Helm is not deleting CRDs #4840

Closed
Closed

Description

@gintautassulskus

I installed a cert-manager chart. The chart comes with several CRDs. Then, I deleted the chart but the CRDs were not cleaned up. Subsequent attempts to install cert-manager chart are now failing because of the lingering CRDs.

Output of helm version: v2.11.0

Output of kubectl version: v1.12.0

Cloud Provider/Platform (AKS, GKE, Minikube etc.): minikube

Activity

  1. mattfarina commented on Oct 29, 2018

    @mattfarina
    Collaborator

    As a short term fix you can use kubectl to delete the CRDs. For example, you can list CRDs with the command kubectl get crds and you can delete one with kubectl delete crd [NAME].

    I'm going to dig into this a little more. We either need to better document this or fix a bug.

  2. mortent commented on Oct 29, 2018

    @mortent

    I think this is closely related to this issue: #4697
    The limitations (and caveats) of using the crd-install hook is pretty well described in the initial PR #3982, but I think the documentation could be improved.

  3. gintautassulskus commented on Oct 30, 2018

    @gintautassulskus
    Author

    Thanks, @mattfarina, this is what I am doing at the moment. Although it complicates automation code.

    Also, I feel the following issue is somewhat related. An attempt to add a custom cert-manager's resource ClusterIssuer gives:

    Error: unable to decode "": no kind "ClusterIssuer" is registered for version "certmanager.k8s.io/v1alpha1"
    

    with the culprit being cert-manager/templates/custom-crd.yaml:

    apiVersion: certmanager.k8s.io/v1alpha1
    kind: ClusterIssuer
    metadata:
      name: acme-issuer
      annotations:
        "helm.sh/hook": "post-install,post-upgrade"
        "helm.sh/hook-delete-policy": "hook-succeeded"
    spec:
      acme:
        # The ACME server URL
        server: "server"
        # Email address used for ACME registration
        email: "email"
        # Name of a secret used to store the ACME account private key
        privateKeySecretRef:
          name: acme-issuer
        # Enable the HTTP-01 challenge provider
        http01: {}

    Steps to reproduce:

    git clone https://github.com/gintautassulskus/charts /tmp/cert-manager-crd-issue
    cd /tmp/cert-manager-crd-issue
    git checkout cert-manager-crd-issue
    helm dependency update stable/cert-manager/
    helm package stable/cert-manager/
    helm install stable/cert-manager/
    
  4. bacongobbler commented on Dec 9, 2019

    @bacongobbler
    Member

    I'm going to close this ticket due to inactivity, but please re-open if this still needs to be addressed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions