Azure-docs: Installing cert-manager fails - "certificates.certmanager.k8s.io" already exists

Created on 20 Dec 2018  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

I am trying to install cert-manager on my RBAC-enabled cluster using the following helm install:

helm install stable/cert-manager
    --namespace kube-system
    --set ingressShim.defaultIssuerName=letsencrypt-staging
    --set ingressShim.defaultIssuerKind=ClusterIssuer

But I get the following error:

Error: release undercooked-koala failed: customresourcedefinitions.apiextensions.k8s.io "certificates.certmanager.k8s.io" already exists

Description of certificates.certmanager.k8s.io:

Name:         certificates.certmanager.k8s.io
Namespace:
Labels:       app=cert-manager
              chart=cert-manager-v0.5.2
              heritage=Tiller
              release=undercooked-koala
Annotations:  helm.sh/hook=crd-install
API Version:  apiextensions.k8s.io/v1beta1
Kind:         CustomResourceDefinition
Metadata:
  Creation Timestamp:  2018-12-20T09:18:42Z
  Generation:          1
  Resource Version:    75571
  Self Link:           /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/certificates.certmanager.k8s.io
  UID:                 3e76037d-0438-11e9-81ca-06aa78d6e763
Spec:
  Group:  certmanager.k8s.io
  Names:
    Kind:       Certificate
    List Kind:  CertificateList
    Plural:     certificates
    Short Names:
      cert
      certs
    Singular:  certificate
  Scope:       Namespaced
  Version:     v1alpha1
Status:
  Accepted Names:
    Kind:       Certificate
    List Kind:  CertificateList
    Plural:     certificates
    Short Names:
      cert
      certs
    Singular:  certificate
  Conditions:
    Last Transition Time:  2018-12-20T09:18:42Z
    Message:               no conflicts found
    Reason:                NoConflicts
    Status:                True
    Type:                  NamesAccepted
    Last Transition Time:  2018-12-20T09:18:42Z
    Message:               the initial names have been accepted
    Reason:                InitialNamesAccepted
    Status:                True
    Type:                  Established
Events:                    <none>

I could install cert-manager without it creating custom resources, like this:

helm install --name cert-manager stable/cert-manager --set createCustomResource=false

But I am not sure of what next to do?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

container-servicsvc cxp triaged

Most helpful comment

So I've been able to successfully deploy cert-manager by running the following:

helm install --name cert-manager stable/cert-manager --namespace kube-system --set createCustomResource=false

helm upgrade --install --namespace kube-system cert-manager stable/cert-manager --set createCustomResource=true --set ingressShim.defaultIssuerName=letsencrypt-staging --set ingressShim.defaultIssuerKind=ClusterIssuer

The CRDs are also created.

All 7 comments

@davenewza provide the helm version you are using.
As a quick fix you can delete the customresourcedefinitions and try again.
command for deleting the crd is kubectl delete crd <name>.

It seems that after I run the helm install command above, the following resource definitions are created (even though the command fails):

kubectl get customresourcedefinition --all-namespaces=true

NAME                                AGE
certificates.certmanager.k8s.io     53s
clusterissuers.certmanager.k8s.io   53s
issuers.certmanager.k8s.io          53s

But the helm deployment is still FAILED. If I delete it (helm delete cert-manager --purge), then the resource definitions are also removed.

Even if the resource definitions do not exist, install cert-manager still yields the same error.

The only way I can get it to install properly is with createCustomResource=false:

helm install --name cert-manager stable/cert-manager --namespace kube-system --set createCustomResource=false

Helm version:

Client: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}

kubectl version:

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.11", GitCommit:"1bfeeb6f212135a22dc787b73e1980e5bccef13d", GitTreeState:"clean", BuildDate:"2018-09-28T21:35:22Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

So I've been able to successfully deploy cert-manager by running the following:

helm install --name cert-manager stable/cert-manager --namespace kube-system --set createCustomResource=false

helm upgrade --install --namespace kube-system cert-manager stable/cert-manager --set createCustomResource=true --set ingressShim.defaultIssuerName=letsencrypt-staging --set ingressShim.defaultIssuerKind=ClusterIssuer

The CRDs are also created.

@davenewza i had the same error with helm 2.12.0 for istio chart. #20820
Worked after downgrading to 2.11.0. Can you try that.

Got a issue and pull request from helm repo which fixes this issue.
issue is helm/helm#5054
Pull request
solution is to migrate to 2.12.1 which is a patch release for 2.12.0 which fixes the issue.

@davenewza I am closing this issue for now. If you need additional help feel free to reopen.

Note that 12.12.1 isn't available on chocolatey yet: https://chocolatey.org/packages/kubernetes-helm

Was this page helpful?
0 / 5 - 0 ratings