Skip to content

Error: rendered manifests contain a resource that already exists but nothing shows up on helm list --all #7418

Closed

Description

@saicharanduppati

Output of helm version:
version.BuildInfo{Version:"v3.0.1", GitCommit:"7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState:"clean", GoVersion:"go1.13.4"}

Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:39:04Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1", GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T10:31:33Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}

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

I'm trying to helm install but helm comes back saying with following error
Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: CustomResourceDefinition, namespace: , name: scheduledsparkapplications.sparkoperator.k8s.io

but when I do helm list --all, nothing comes up and therefore I unable to remove any resource to proceed with installation.

Any help appreciated! Thanks!

See the attached screenshot:
Screen Shot 2020-01-16 at 3 36 00 PM

Activity

  1. hickeyma commented on Jan 17, 2020

    @hickeyma
    Contributor

    @saicharanduppati It seems like CRD scheduledsparkapplications.sparkoperator.k8s.io already exists in your cluster. This is causing the conflict.

    BTW, to get all releases in all namespaces, use --all-namespaces flag with helm ls.

  2. saicharanduppati commented on Jan 17, 2020

    @saicharanduppati
    Author

    Thanks for the quick response, @hickeyma

    It makes sense it exists in the cluster, but I don't see anything on helm ls --all-namespaces. I think the clue might be in that there is no namespace attached to previous installation. Not sure, how that got through.

    Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: CustomResourceDefinition, namespace: , name: scheduledsparkapplications.sparkoperator.k8s.io

    Screenshot from 2020-01-17 10-12-40

  3. hickeyma commented on Jan 20, 2020

    @hickeyma
    Contributor

    The CRD could exist because the chart that deployed it, may not remove the CR object from the cluster. In Helm 3, this is expected behaviour as Helm will only install CRDs.

    I just mentioned the --all-namespaces flag for your information.

  4. boxcee commented on Jan 22, 2020

    @boxcee

    I have the same problem.

    Helm:

    version.BuildInfo{Version:"v3.0.2", GitCommit:"19e47ee3283ae98139d98460de796c1be1e3975f", GitTreeState:"clean", GoVersion:"go1.13.5"}
    

    Command I run:

    helm install sparkoperator incubator/sparkoperator --namespace sparkoperator --version 0.6.1
    

    Error message:

    Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: CustomResourceDefinition, namespace: , name: sparkapplications.sparkoperator.k8s.io
    

    I tried removing the CRDs manually as I cannot find any chart installed (even with --all-namespaces). Does not help. On install I get the same error message again.

    EDIT: incubator/sparkoperator chart says this about CRDs:

    Wether the release should install CRDs. Regardless of this value, Helm v3+ will install the CRDs if those are not present already. Use --skip-crds with helm install if you want to skip CRD creation
    

    Setting installCrds: false will install the chart but is unexpected hehavior.

  5. misterspeedy commented on Feb 4, 2020

    @misterspeedy

    Same issue here.

    Followed the steps in https://docs.microsoft.com/en-us/azure/aks/ingress-basic.

    Then deleted the namespace:

    kubectl delete namespace <mynamespace>
    

    Then performed the steps again, got the 'resource that already exists' error at the helm install nginx-ingress... step.

    If I do

    helm list --all
    

    ...I get an empty list.

    I'm a beginner at all of these but it seems to me the process should be idempotent.

  6. misterspeedy commented on Feb 4, 2020

    @misterspeedy

    Further to the above

     kubectl get crd
    

    Returns just one item which was created last September and so presumably isn't relevant.

  7. misterspeedy commented on Feb 4, 2020

    @misterspeedy

    Adding --skip-crds to the helm install... command gives the same error.

  8. misterspeedy commented on Feb 4, 2020

    @misterspeedy

    Tried repeating the first three steps of the tutorial using the original namespace from the tutorial. I.e. ingress-basic. Got the same error, so whatever leaked, it isn't namespaced.

  9. vaishali-prophecy commented on Feb 14, 2020

    @vaishali-prophecy

    Getting the same error.
    helm version
    version.BuildInfo{Version:"v3.0.3", GitCommit:"ac925eb7279f4a6955df663a0128044a8a6b7593", GitTreeState:"clean", GoVersion:"go1.13.7"}

    --skip-crds also doesnt help.. Also, is there a way to make this operation idempotent instead of passing different flags each time? Example - Say I have a chart to deploy an application and this chart also has some crds in crds/ directory. Now if I want to install 2 instances of this application, I cannot do it as second install gives a resource conflict with kind : CustomResourceDefinition

  10. sehz commented on Feb 20, 2020

    @sehz

    same issue. It started with deleting namespace without uninstalling chart.
    After I removed my CRD definitions, I was able to install chart.
    However, if I remove and install chart again, the installation fails again with same message.

    I tried both Helm v3.0 and V3.10. Same problem

  11. scbizu commented on Feb 25, 2020

    @scbizu

    kubectl get all and delete the reported conflict resource(or all related resources if needed? ) works for me.

  12. hickeyma commented on Feb 25, 2020

    @hickeyma
    Contributor

    This initial issue opened by @saicharanduppati was resolved in #7418 (comment).

    Even though symptoms are the same for @boxcee @misterspeedy @vaishali-prophecy @sehz, the main issue is some resource that is in the cluster conflicting with trying to deploy a chart. In this case, if they chart release no longer exists (for whatever reason) and resources are left behind in the cluster, then manually removing them using kubectl is the best approach.

    This is pretty much the approach used b y @ieciura and @scbizu.

  13. hickeyma commented on Feb 25, 2020

    @hickeyma
    Contributor

    Going to close this PR because it was resolved for the person who raised it.

    If you have issues similar to these symptoms, raise a new issue putting in the details of how it fails for you.

  14. 7 remaining items

  15. added a commit that references this issue on Apr 25, 2020
  16. slavaaaaaaaaaa commented on May 8, 2020

    @slavaaaaaaaaaa

    I was having the same issue running 3.2.0. I finally figured out that my ingress had no name defined. Pretty embarrassing.

  17. Celakanth-VSI commented on Jan 26, 2021

    @Celakanth-VSI

    I just gave it a new name helm install nginx-ingressdv ingress-nginx/ingress-nginx seemed to work

  18. chetanagrawal commented on Mar 16, 2021

    @chetanagrawal

    Just go on deleting the conflicting resources (as you see in the error message) and it should work. In my case I had to delete 3 resources:

    kubectl delete rolebinding -n kube-system aws-load-balancer-controller-leader-election-rolebinding
    kubectl delete mutatingwebhookconfiguration aws-load-balancer-webhook
    kubectl delete validatingwebhookconfiguration aws-load-balancer-webhook

  19. maniankara commented on Mar 30, 2021

    @maniankara

    Wondering why there is suggestions and lot of support for deletion of resources 🤔 Atleast I cannot do it straight into my production clusters.. 😃

  20. pnutmath commented on May 11, 2021

    @pnutmath

    kubectl get CustomResourceDefinition --all-namespaces works for me to get the CustomResourceDefinition attached to no namespace

  21. Yougigun commented on Jun 3, 2021

    @Yougigun

    Solution:

    kubectl delete clusterrole nginx-ingress

    kubectl delete clusterrolebinding nginx-ingress

    this works also for some similiar issue. thx a lot.

  22. shaneutt commented on Oct 19, 2021

    @shaneutt

    I encountered this problem with CRDs in a situation where deletion was not an option and solved the problem with the following script:

    #!/bin/bash
    
    set -euo pipefail
    
    for CRD in $(kubectl get crds -o=name | grep "${GROUP}")
    do
        kubectl label ${CRD} app.kubernetes.io/managed-by=Helm --overwrite
        kubectl annotate ${CRD} meta.helm.sh/release-name=${HELM_RELEASE} --overwrite
        kubectl annotate ${CRD} meta.helm.sh/release-namespace=${HELM_RELEASE_NAMESPACE} --overwrite
    done

    Run with:

    $ GROUP=<your crd group> HELM_RELEASE=<your release name> HELM_RELEASE_NAMESPACE=<your release namespace> importCRDs.sh

    After that the upgrade succeeded and the CRDs became managed by the release. I was using Helm v3.7.0.

  23. JornShen commented on Dec 10, 2021

    @JornShen

    @shaneutt I face same problems. But I add same label and annotation for my detailed ds and service account, it doesn't work. should I label and annotation for all the resources?

  24. er-jagdish commented on Jan 26, 2022

    @er-jagdish

    for me, its same issue and helm ls --all-namespaces is not listing the namespace that i am looking.

    kubectl get namespaces--- for me this was the issue

    kubectl delete ns jenkins ==> deleted the required name space

    you can delete the duplicate one.

  25. TorvaldsDB commented on Mar 2, 2022

    @TorvaldsDB

    I guess you have installed the servers by Helm2, and now you are using Helm3.

    I did the following scripts, and it works now:

    kubectl delete service -n <namespace> <service-name>
    kubectl delete deployment -n <namespace> <deployment-name>
    kubectl delete ingress -n <namespace> <ingress-name>
  26. jribmartins commented on Mar 9, 2022

    @jribmartins

    In my case I had some generateName instead of names in metadata:

    metadata:
      generateName: random-
    

    after changing this to name I could install the chart again

  27. CharlyPierce commented on Dec 2, 2022

    @CharlyPierce

    In my case add:
    kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission

    check for the clusterrole and clusterrolebinding delete them all, it should solve the problem

    kubectl get clusterrole | grep ingress kubectl get clusterrolebinding | grep ingress

    it did solve in my case.

  28. mb250351 commented on Feb 3, 2023

    @mb250351

    In my case add: kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission

    you are a Genious and saved my life. thank you.

  29. joaquin-izaguirre-uvi commented on Sep 21, 2024

    @joaquin-izaguirre-uvi

    Hi, I had have the same problem with ingress-nginx but I could resolver delete:

    kubectl delete ClusterRole ingress-nginx
    kubectl delete ClusterRoleBinding ingress-nginx
    kubectl delete IngressClass nginx

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