Skip to content

crd-install annotation doesn't work #4259

Closed

Description

@yevhenvolchenko

#3982
@technosophos

BUG

Output of helm version:
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}

Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDate:"2018-06-06T15:22:13Z", GoVersion:"go1.9.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10+", GitVersion:"v1.10.4-gke.2", GitCommit:"eb2e43842aaa21d6f0bb65d6adf5a84bbdc62eaf", GitTreeState:"clean", BuildDate:"2018-06-15T21:48:39Z", GoVersion:"go1.9.3b4", Compiler:"gc", Platform:"linux/amd64"}

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

Steps to reproduce

  1. Download https://github.com/kubernetes/charts/tree/master/stable/cert-manager
  2. Update ./cert-manager/templates/certificate-crd.yaml's, ./cert-manager/templates/clusterissuer-crd.yaml's, ./cert-manager/templates/issuer-crd.yaml's matadata: with:
  annotations:
    "helm.sh/hook": crd-install
  1. Add stage.yaml to ./cert-manager/templates:
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
  name: letsencrypt-stage
spec:
  acme:
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    email: [email protected]

    # Name of a secret used to store the ACME account private key
    privateKeySecretRef:
      name: letsencrypt-staging

    # ACME DNS-01 provider configurations
    http01: {}
  1. Run helm install --name cert-manager --namespace kube-system ./cert-manager

Output:
Error: apiVersion "certmanager.k8s.io/v1alpha1" in cert-manager/templates/stage.yaml is not available

Output tiller:
[tiller] 2018/06/22 11:10:37 preparing install for cert-manager
[storage] 2018/06/22 11:10:37 getting release history for "cert-manager"
[tiller] 2018/06/22 11:10:37 rendering cert-manager chart using values
2018/06/22 11:10:37 info: skipping unknown hook: "crd-install"
2018/06/22 11:10:37 info: manifest "cert-manager/templates/00-namespace.yaml" is empty. Skipping.
2018/06/22 11:10:37 info: skipping unknown hook: "crd-install"
[tiller] 2018/06/22 11:10:37 failed install prepare step: apiVersion "certmanager.k8s.io/v1alpha1" in cert-manager/templates/cluster-issuer-stage.yaml is not available

Activity

  1. bacongobbler commented on Jun 22, 2018

    @bacongobbler
    Member

    Can you try a canary release? I don't think this feature exists in 2.9 at this point, only in master.

  2. bamb00 commented on Jun 22, 2018

    @bamb00

    @bacongobbler Where can I get the canary release?

  3. bacongobbler commented on Jun 22, 2018

    @bacongobbler
    Member
  4. bacongobbler commented on Jun 22, 2018

    @bacongobbler
    Member

    Closing as answered but please feel free to re-open if you have further issues. Thanks!

  5. bamb00 commented on Jun 23, 2018

    @bamb00

    @bacongobbler I'm running version 2.8.1, got this error failed: no objects visited.

       Error: release prometheus-crd failed: no objects visited
    

    Is it because the feature is not available?

    Thanks in advance.

  6. yevhenvolchenko commented on Jun 25, 2018

    @yevhenvolchenko
    Author

    @bacongobbler
    It's in v2.9.1, isn't it?

    v2.9.1...master

    0699ec4

  7. gintautassulskus commented on Jul 3, 2018

    @gintautassulskus

    Does not seem to work in v2.9.1:

      annotations:
        "helm.sh/hook": "post-install"
    

    Still getting:
    Error: apiVersion "certmanager.k8s.io/v1alpha1" in ca-issuer.yaml is not available

  8. bacongobbler commented on Jul 3, 2018

    @bacongobbler
    Member

    As mentioned previously, this is not available in 2.9, and definitely not in 2.8. it will become available in 2.10. you can test the release candidate if you want to use it!

  9. gintautassulskus commented on Jul 3, 2018

    @gintautassulskus

    Thanks. I misunderstood that 2.9 is not the same as 2.9.* and that 2.9 != 2.9.1

  10. bacongobbler commented on Jul 3, 2018

    @bacongobbler
    Member

    Oh sorry! Probably getting lost in translation. When I mean 2.9 I really mean 2.9.x, which is to say that this feature does not exist in any 2.9.x release tag. :)

  11. awcheney commented on Sep 21, 2018

    @awcheney

    Hi folks - is this available in 2.10? I ask because we're using 2.10 and cannot get our Istio installation to work. We are using the Istio chart at https://github.com/istio/istio/tree/master/install/kubernetes/helm as a subchart of our one; our chart fails with:
    Error: validation failed: [unable to recognize "": no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3", unable to recognize "": no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3",[... there are another 50-odd of these].

  12. awcheney commented on Sep 21, 2018

    @awcheney

     helm version
    Client: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}
    Server: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}

  13. bacongobbler commented on Sep 21, 2018

    @bacongobbler
    Member

    yep! #3982 was made available in v2.10.0.

  14. desaintmartin commented on Sep 21, 2018

    @desaintmartin

    This is funny because I have the same problem upgrading to the latest version of stable/cert-manager (v0.5.0), which adds this annotation: helm/charts@e0505bb#diff-8b13fd9d83b627ff683d00d1e7ed5d6d.

    It actually removed my CRDs. In this case, it doesn't cause helm to fail, but causes cert-manager to be completely blocked.

  15. bacongobbler commented on Sep 21, 2018

    @bacongobbler
    Member
  16. munnerz commented on Sep 21, 2018

    @munnerz
    Contributor

    Huh. This seems like Helm behaving weirdly when upgrading a Helm chart that previously did not have a crd-install hook.

    We don't do anything fancy here, so my guess is this is a bug in Helm itself.

    Can anyone more familiar with this area of Helm's code comment on how the upgrade may be handled?

  17. munnerz commented on Sep 21, 2018

    @munnerz
    Contributor

    Perhaps this should be broken out into a new issue 😄

    cc @technosophos

  18. maver1ck commented on Sep 26, 2018

    @maver1ck

    Added new issue.
    I have same problem.
    The workaround is to reinstall cert-manager chart.

  19. mmerrill3 commented on Sep 26, 2018

    @mmerrill3

    Hi all, we too ran into this issue, where we upgraded using the new chart for version 0.5.0, and it completely removed all of our instantiated CRDs. We had to manually put them back, since the instances of the CRDs were spread out amongst many projects that were deployed as separate helm charts.

  20. adamcheney commented on Oct 5, 2018

    @adamcheney

    @bacongobbler - sorry for the delay - lots of other stuff on...
    We're definitely using Helm 2.10 (version as per my last post a couple of weeks ago) but the hook does not seem to work for us. I'm trying to install the Istio chart from https://github.com/istio/istio/tree/master/install/kubernetes/helm/istio - I know their instructions say to pre-install the CRDs with a 'kubectl apply -f' but with this version of helm is should just work, right?
    It doesn't...:

    Error: validation failed: [unable to recognize "": no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3", unable to recognize "": no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3", unable to recognize

    [...]
    All these CustomResourceDefinitions have the annotation:

      annotations:
        "helm.sh/hook": crd-install
    

    This is not an upgrade - this was a pull from github and then a helm install into k8s (after scrubbing all traces of past efforts out.

    What am I missing?

  21. munnerz commented on Oct 5, 2018

    @munnerz
    Contributor

    I've opened #4740 to discuss the issues with crd-install that we have previously discussed here @mmerrill3 @maver1ck @desaintmartin

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