Skip to content

can't delete multiple crds resources with before-hook-creation #4591

Closed

Description

@guangbochen

Output of helm version: v2.10.0

Output of kubectl version: 1.10.4

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

Description: for a chart with multiple CRD resources(e.g, 4), the hook

annotations:
    "helm.sh/hook": crd-install
    "helm.sh/hook-delete-policy": "before-hook-creation"

has been added for each CRD resource but it won't be able to delete all CRD resource when run the $helm install, and tiller will return the error message as below:

[tiller] 2018/09/05 07:03:28 performing install for demo
[tiller] 2018/09/05 07:03:28 executing 6 crd-install hooks for demo
[tiller] 2018/09/05 07:03:28 deleting crd-install hook alertmanagers.monitoring.coreos.com for release demo due to "before-hook-creation" policy
[kube] 2018/09/05 07:03:28 Starting delete for "alertmanagers.monitoring.coreos.com" CustomResourceDefinition
[kube] 2018/09/05 07:03:28 building resources from manifest
[kube] 2018/09/05 07:03:28 creating 1 resource(s)
[tiller] 2018/09/05 07:03:28 warning: Release demo crd-install prometheus-operator/templates/alertmanager-crd.yaml failed: object is being deleted: customresourcedefinitions.apiextensions.k8s.io "alertmanagers.monitoring.coreos.com" already exists
[tiller] 2018/09/05 07:03:28 failed install perform step: object is being deleted: customresourcedefinitions.apiextensions.k8s.io "alertmanagers.monitoring.coreos.com" already exists

Expected Results: all CRD resources with "helm.sh/hook-delete-policy": "before-hook-creation" hook should remove altogether.

Ref: https://github.com/helm/helm/blob/master/docs/charts_hooks.md#automatically-delete-hook-from-previous-release.

Activity

  1. raoofm commented on Dec 13, 2018

    @raoofm

    experiencing the same issue with
    helm v2.10.0
    kubectl v1.10.11

  2. alexey-igrychev commented on Jan 16, 2019

    @alexey-igrychev

    I've looked into the code and related issue #4440.

    I agree with #4440 (comment), thus suggest to add watch until hook deleted only for before_hook_creation policy here (https://github.com/helm/helm/blob/master/pkg/tiller/release_server.go#L454).

    1. Delete resource with before_hook_creation policy.
    2. Watch until deleted.
    3. Create resource.

    @technosophos, what do you think?

  3. bacongobbler commented on Dec 9, 2019

    @bacongobbler
    Member

    Moving forward, please use the crds directory instead of the crd-install hook, which was deprecated in Helm 3. Closing!

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