-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
helm chart CRD installation first when installed as dependency #226
Comments
This is what we used to have, but the CRDs were not being updated then. Helm does not provide a good story here. |
well then its a trade-off. We have experienced that the current behavior for a new installation is quite flakey. the helm install command actually misses installation of some of the CRDs some of the time. also is there a point to how the files are named? does this actually work as a way to define installation order? |
@agnewp I can see that you are reporting KEDA version 1.5.1, but that error mentiones:
which is a version of a resource used on KEDA 2.X. I definitely recommend you to use 2.x version, 1.x is deprecated. |
my mistake, i am using 2.5.1 |
The alternative approach will silently continue giving you incomplete CRDs. However, I will take a look when I have time but we might want to use both approaches as a hack: |
Let me try the chart again tomorrow though because last time I checked I didn't have issues. |
So what I did was:
~ k get crds
NAME CREATED AT
volumesnapshotclasses.snapshot.storage.k8s.io 2022-01-12T12:24:40Z
volumesnapshotcontents.snapshot.storage.k8s.io 2022-01-12T12:24:40Z
volumesnapshots.snapshot.storage.k8s.io 2022-01-12T12:24:40Z
~ helm install keda --version 2.5.1 --namespace keda-system kedacore/keda
NAME: keda
LAST DEPLOYED: Wed Jan 12 13:37:00 2022
NAMESPACE: keda-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
~ k get crds
NAME CREATED AT
clustertriggerauthentications.keda.sh 2022-01-12T12:37:05Z
scaledjobs.keda.sh 2022-01-12T12:37:05Z
scaledobjects.keda.sh 2022-01-12T12:37:05Z
triggerauthentications.keda.sh 2022-01-12T12:37:05Z
volumesnapshotclasses.snapshot.storage.k8s.io 2022-01-12T12:24:40Z
volumesnapshotcontents.snapshot.storage.k8s.io 2022-01-12T12:24:40Z
volumesnapshots.snapshot.storage.k8s.io 2022-01-12T12:24:40Z So everything seems fine. Can you provide some more information about your environment? Keeping in mind that you use it as a Helm dependency of course, I'll test that next. |
Ok I can reproduce this: ~ helm install metachart .
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "TriggerAuthentication" in version "keda.sh/v1alpha1" Will take a stab at a fix later this week/next week. (will do my best) |
Workaround: Install KEDA outside of the current Helm chart. |
This is indeed what we did to work around the issue. however, even installing Keda stand-alone with the current chart, we ran into inconsistent issues with the chart failing to install all of the CRDs. very strange. i wonder if some of the CRDs depend on eachother? |
We do not have knowledge about that issue. Can you still reproduce this with the latest version? |
Would it help if there is a Helm chart with solely the CRDs that you can install first? |
Is there an open issue for that in helm?
Do you mean that we would add two dependencies in the chart like this:
I think that could work for me. |
Yes, see above but link is helm/helm#10585
No, so you can deploy the CRDs before the application. Having it as two dependencies would have same issue. |
I would add that for some of us that are using
Then I tried to extract the Having one chart |
Thanks for bumping this thread again, unfortunately no change on the Helm side.
If we do this, then you would be unblocked if I get it correctly? |
Hi @tomkerkhove, thanks for the fast reply :)!
Yeah, the Helm implementation is really not ideal...
Yes that's right. I would be unblocked in my case, and I think that having both charts separated would likely solve other cases as well.
|
What are your thoughts on this @kedacore/keda-maintainers? I think if we do this we should do the following:
Thoughts? |
@tomkerkhove I just realised that you can use the following in the crds:
install: false This will prevent |
Sounds good, thanks for letting us know! |
I just ran into the same issue. I ended up taking the CRDs from the |
Adds autoscalers for the inbox-listener and stream service. The inbox listener autoscaler relies on KEDA. The stream service autoscaler is a standard HPA. KEDA has some unfortunate friction with helm. It cannot be added as a dependency to the chart and installed in a reasonable way, because it relies on CRDs, which helm will not be responsible for updating or installing in order. Based on conversation in kedacore/charts#226, there are two alternative approaches open to us: * We can instruct users to install KEDA on their cluster prior to installing our deployment. The command for this is, helm install keda --version 2.9.1 --namespace keda kedacore/keda --create-namespace * We can vendor KEDA's CRDs and put them into our chart, under a crd directory. This should enable a single-command install, but comes with the downsides that, 1. Helm will not update or manage the keda CRDs for us 2. If users already have KEDA installed (certainly possible) we will encounter a conflict. Mainly due to the second item, this PR takes the first approach.
Adds autoscalers for the inbox-listener and stream service. The inbox listener autoscaler relies on KEDA. The stream service autoscaler is a standard HPA. KEDA has some unfortunate friction with helm. It cannot be added as a dependency to the chart and installed in a reasonable way, because it relies on CRDs, which helm will not be responsible for updating or installing in order. Based on conversation in kedacore/charts#226, there are two alternative approaches open to us: * We can instruct users to install KEDA on their cluster prior to installing our deployment. The command for this is, helm install keda --version 2.9.1 --namespace keda kedacore/keda --create-namespace * We can vendor KEDA's CRDs and put them into our chart, under a crd directory. This should enable a single-command install, but comes with the downsides that, 1. Helm will not update or manage the keda CRDs for us 2. If users already have KEDA installed (certainly possible) we will encounter a conflict. Mainly due to the second item, this PR takes the first approach.
[TL;DR] [Longer description] Many projects are struggling with similar Helm challenges, but I guess I've everywhere seen recommendations and solutions that allows extracting CRDs from the Chart, e.g.:
|
This is not 100% correct - If you use Helm, it will install/update them. For non-Helm scenarios we offer them as YAML in our GitHub release. I'm happy to adapt and align with the |
I meant Helm scenario and the whole point is to have any option to use Helm, but without CRDs and easy way to install CRDs separately. |
So having a YAML file with just CRDs in the releases would help? |
In our case yes. We would have an easy way to install/maintain only CRDs first and then Helm Chart without CRDs. |
What is the problem if you don't skip CRDs with the installation of the main chart? I'm trying to understand why skipCRDs is a thing |
@daodennis-ri Usually it's not big difference whether CRDs will be installed first time with Helm or without (e.g. kubectl) if can be later easily maintained (updated) outside and if are not tracked by Helm later on , something like Methond 1 in Helm docs. The Helm idea is to allow such installation (or skip) using manifests in With KEDA chart the issue and main difference is that |
I'm having a similar problem. I'm trying to install cloudnative-pg's helm chart as a dependency (set in |
+1 Same Problem |
After fiddling with this for a while, I've reached the conclusion that the concept of Helm subcharts is fundamentally flawed. This is specially true for CRDs, or charts containing non-namespaced resources. The solution we have arrived at is the same as the one proposed by most Helm charts containing CRDs. Have them as a separate Helm installation, decoupled for your target chart. |
So what is the recommended approach should we install keda out of the main helm chart and not add it as a dependency? Because I am still facing this issue where it fails saying CRD's doesn't exist |
@tomkerkhove Any update on your keda-crd chart? We are encountering the same issue and would like to be able to use that. |
A clear and concise description of what the bug is.
Expected Behavior
Keda can be installed from its chart as a dependency of another custom chart that uses Keda CRDs
Actual Behavior
Helm expects that CRDs need to be installed BEFORE other resources that potentially use these CRDS. when KEDA is a dependent chart of another one that attempts to use KEDA CRDs, the helm installation fails.
Steps to Reproduce the Problem
installation failed: unable to build kubernetes objects from release manifest: unable to recognize \"\": no matches for kind \"TriggerAuthentication\" in version \"keda.sh/v1alpha1\"
Specifications
the good news is that you aren't the first people to run into this problem, i see someone made a crude attempt at enforcing installation order by making the file names look like linux init.d scripts in some kind of assumption that helm doesn't do things in parallel. check this out: https://helm.sh/docs/chart_best_practices/custom_resource_definitions/
the fix is supper simple; put the crd definitions into a folder called 'crds' and boom! helm will install the CRD defs first every time!
The text was updated successfully, but these errors were encountered: