Skip to content

Managing CRDs & chart dependendies #10585

Closed

Description

@tomkerkhove

KEDA provides CRDs for their end-users as part of the Helm installation.

Initially we followed the guidance to use crds/ folder to let Helm manage it, but we've noticed that the CRD is not being updated and moved away from it.

Instead, we have added them to the templates folder with an option to skip them if need be.

The only issue that has come up now is when our Helm chart is a dependency of another Helm chart. The issue is that Helm does not wait until KEDA has been installed so the main chart tries to use a CRD that was not installed yet.

What is Helm's guidance on this? Because using crds/ is not an option since it does not update CRDs.

Repro is available on https://github.com/tomkerkhove/keda-helm-dependency.

Relates to kedacore/charts#226

Activity

  1. joejulian commented on Jan 21, 2022

    @joejulian
    Contributor

    Unfortunately, Helm does not provide any support around upgrading CRDs . See HIP 11 for more details.

    The way our company has worked around this is to include the CRDs into ConfigMaps and use pre-install,pre-update jobs to apply them. Here's an example

  2. tomkerkhove commented on Jan 23, 2022

    @tomkerkhove
    Author

    Thank you for the example, I will take a look but most probably this has the same issue - The job will not be guaranteed to be completed before the dependent chart gets installed.

    I will have a look at the HIP, but this seems to be a gap in Helm for doing CRD lifecycle management :/

  3. github-actions commented on Apr 24, 2022

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  4. tomkerkhove commented on Apr 25, 2022

    @tomkerkhove
    Author

    Bumping as this is still a problem.

  5. hickeyma commented on Apr 25, 2022

    @hickeyma
    Contributor

    @tomkerkhove The policy on CRDs was provided by @joejulian above. The document explains the reasoning behind the limited support for CRDs by Helm.

    I re-opened this issue but not sure how this can be progressed further.

  6. tomkerkhove commented on Apr 26, 2022

    @tomkerkhove
    Author

    Given how many people struggle with this I believe it would be beneficial to provide a better story in Helm but that is easily said.

    If that is not possible, then having guidance in the documentation on how to manage CRDs through workaround such as the above would be a huge help.

    Would that make sense?

  7. hickeyma commented on Apr 26, 2022

    @hickeyma
    Contributor

    The bottom line is that Helm has: "no support at this time for upgrading or deleting CRDs using Helm. This was an explicit decision after much community discussion due to the danger for unintentional data loss."

    There are some suggestions given here and also here. If you need more capability outside of CRD install then Helm recommends using separate charts. In essence it is saying that you need to manage your CRDs yourself and @joejulian provided the way they do it in #10585 (comment). It is a case of which way suits your setup.

  8. ldemailly commented on May 11, 2022

    @ldemailly

    re

    "Nobody is "Blocked"
    [...]

    First, there are widely documented patterns and work-arounds for how to handle CRDs. The most common is the pattern of separating CRDs into a separate chart that then treats these CRDs as standard resources."

    How does having another chart changes that CRDs aren't being updated anyway after the first application?

    I would love any solution (a flag or anything) that avoids #7735 (comment)

  9. xashr commented on Jun 2, 2022

    @xashr

    I understand that the CRDs are difficult to integrate into the Helm concept. But then Helm should not provide unusable features like the crds/ folder, which allows CRDs to be installed, but not upgraded. Who actually uses that?

  10. tomkerkhove commented on Jun 2, 2022

    @tomkerkhove
    Author

    We used to use it, and later on noticed that all our CRDs had gone stale for a few releases..

  11. github-actions commented on Sep 1, 2022

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

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