Skip to content

CRDs not being applied correctly #2994

Closed

Description

@lachie83

I'm seeing the following when installing the chart in this PR helm/charts#2369

$ helm install --name istio . --namespace istio-system
Error: unable to decode "": no kind "CustomResourceDefinition" is registered for version "apiextensions.k8s.io/v1beta1"

If I render the files with CRDs manually using helm template and install using kubectl create -f they work just fine.

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.6", GitCommit:"4bc5e7f9a6c25dc4c03d4d656f2cefd21540e28c", GitTreeState:"clean", BuildDate:"2017-09-15T08:51:09Z", GoVersion:"go1.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-08-31T08:56:23Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
$ helm version
Client: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.6.1", GitCommit:"bbc1f71dc03afc5f00c6ac84b9308f8ecb4f39ac", GitTreeState:"clean"} 

Activity

  1. redbaron commented on Oct 2, 2017

    @redbaron
    Contributor

    Look at prometheus-operator, helm is not waiting for third party resource to become fully registered, therefore one off install hook is necessary

  2. lachie83 commented on Oct 2, 2017

    @lachie83
    ContributorAuthor

    In this chart the services aren't creating the CRDs. The chart itself creates the CRDs. I've used hooks to order the creation but Helm is having trouble applying them to Kubernetes

  3. bacongobbler commented on Oct 2, 2017

    @bacongobbler
    Member

    Is this a cascading failure from #2995? Let's try the proposed fix in that issue first and see if that fixes things.

  4. lachie83 commented on Oct 2, 2017

    @lachie83
    ContributorAuthor

    This didn't help. I believe there's some funniness when using CRDs/TPRs with hooks. #2680

  5. thomastaylor312 commented on Oct 6, 2017

    @thomastaylor312
    Contributor

    Related: #2925

  6. thomastaylor312 commented on Oct 7, 2017

    @thomastaylor312
    Contributor

    As a note, we are going to pull the ordering part of this into 2.7

  7. thomastaylor312 commented on Oct 11, 2017

    @thomastaylor312
    Contributor

    Pulling this out of 2.7 in favor of #2925

  8. removed this from the 2.7.0 - Features milestone on Oct 11, 2017
  9. fejta-bot commented on Jan 9, 2018

    @fejta-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.

    Prevent issues from auto-closing with an /lifecycle frozen comment.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
    /lifecycle stale

  10. thomastaylor312 commented on Jan 9, 2018

    @thomastaylor312
    Contributor

    /lifecycle frozen

  11. 24 remaining items

  12. kfox1111 commented on Dec 7, 2018

    @kfox1111

    and certmanager

  13. paktek123 commented on Jan 7, 2019

    @paktek123

    I get same thing as @fiunchinho but for heptio-ark when trying to upgrade/install

  14. dabelenda commented on Feb 18, 2019

    @dabelenda

    I am using helm in an OpenShift setup, and trying to manage everything using helm hitting ordering issues very hard...

    In OpenShift there is a CRD called Project, which is a complete replacement of Namespace (it then creates a "virtual" Namespace object Read-Only), thus when I try creating a Project with Quotas, and other official objects from k8s the ordering is messed up.

    I think a good way to let users control ordering with CRDs, would be to, instead of having a static ordering like defined here https://github.com/helm/helm/blob/release-2.13/pkg/tiller/kind_sorter.go#L29 use an integer priority to each object and allow users to set a priority for Kinds in metadata of the chart or something.

  15. whereisaaron commented on Feb 18, 2019

    @whereisaaron
    Contributor

    @dabelenda I've suggested elsewhere that subcharts in requirements.yaml could be weighted/ordered. Then you could split deployments into phases and control the order at that level?
    #1780 (comment)

    It would be nice to be able to e.g. apply weights to subcharts in requirements.yaml, with charts of the same weight being sorted together with the current algorithm. All weights, including parent chart would be zero by default. Negative weights would install before the parent chart, positive weights would install after.

    With this optional feature the processing of all existing charts would be unaffected. And only people who really need ordering would specify any weights for requirements.yaml.

  16. dabelenda commented on Feb 18, 2019

    @dabelenda

    I am "only" creating the Project, Quotas, and RoleBindings here.
    The need to create a dummy subchart to only create a Project and then apply Quotas and RoleBindings is weird.
    Every single CRD that have dependencies will have to be in different subcharts. It would creates hard-to-understand charts if the dependency tree is non trivial.

    I think of Prometheus-Operator Prometheus ServiceMonitoring etc

  17. Ciantic commented on Sep 14, 2019

    @Ciantic

    I'm using helm3 and experience the same problem sporadically, this time with istio resources:

    Error: apiVersion "config.istio.io/v1alpha2" in istio/charts/mixer/templates/config.yaml is not available

    It works occasionally, but most often it just throws me that error. It doesn't happen always.

  18. JulienBreux commented on Sep 17, 2019

    @JulienBreux

    Error

    Error: apiVersion "config.istio.io/v1alpha2" in istio/charts/mixer/templates/config.yaml is not available
    

    Versions

  19. thomastaylor312 commented on Sep 18, 2019

    @thomastaylor312
    Contributor

    Hey @Ciantic and @JulienBreux so this is because your local types/discovery cache is stale after you install a CRD. We have handled this with the new crds/ directory installation in Helm 3. It will invalidate the cache for you. This is due to the way Kubernetes discovery caching works and not due to Helm itself per se. To get around it, you can delete ~/.kube/cache/discovery (or append the cluster name to the end of the path to just remove its specific cache) in between running the install of Istio init and installing Istio itself

  20. Ciantic commented on Sep 18, 2019

    @Ciantic

    @thomastaylor312 it doesn't work. I guess because the main istio chart also tries to install crds?

    helm repo add istio.io https://storage.googleapis.com/istio-release/releases/1.3.0/charts/
    helm repo update
    
    kubectl create namespace istio-system
    
    # Install crds
    helm install istio-init istio.io/istio-init --namespace istio-system
    
    # See https://github.com/helm/helm/issues/2994 for the deleting cache
    rm -rf ~/.kube/cache/discovery/
    
    sleep 3s # This really is installation step!
    
    # Install istio
    helm install istio istio.io/istio \
        --namespace istio-system \
        --set gateways.istio-ingressgateway.type=NodePort

    Throws error:

    Error: apiVersion "config.istio.io/v1alpha2" in istio/charts/mixer/templates/config.yaml is not available
    

    Only thing that works 100% time is normal kubectl apply -f method.

    I want to note that above script works sometimes but usually not. So something funny and non-deterministic there is.

  21. bacongobbler commented on Sep 18, 2019

    @bacongobbler
    Member

    Probably because support for the crd-install hook was dropped in Helm 3 in favour of a crd directory.

  22. Ciantic commented on Sep 18, 2019

    @Ciantic

    You are right. Apparently istio can't be installed with helm3, and probably never will be, because they are working on a different installer. See istio/istio#17167

  23. bacongobbler commented on May 14, 2020

    @bacongobbler
    Member

    closing as resolved with the crds directory. For further discussion on CRDs and Helm, please see #5871. 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

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions