Open darkweaver87 opened 1 month ago
Tested on my own account as seen with you :+1:
@jnoordsij If you think we should not do it, it's still time and possible to explain why !
I definitely have some mixed thoughts about it. While I totally see the issue with CRDs and Helm and the reason this might call for some different structure, that also implies that probably we should tread carefully in finding a solution that works around Helm limitations.
To be more concrete: I can agree with using a separate chart for CRDs, but I'd rather make it entirely stand-alone than add it as a dependency to the main chart. Reasoning:
Some other alternatives we may opt for are:
crd
directory to templates and install from there. Then add a resource-policy to the CRDs to prevent accidental This allows for upgrading them through the chart without the burden/complexity of an entire new chart. I've seen this pattern to be used in the cert-manager
Helm chart, which might serve as a working example employed elsewhere.I think the most important trade-off here is how much knowledge/action is required from the end-user vs. potential risks by simplifying things for them, but in turn making some seemly harmless operations actually unsafe. The usecase which is probably most impacted by any change is whenever there's multiple instance of the chart being installed in the cluster. Given this is an advanced usecase we can probably expect end-users employing this pattern to generally know quite a bit more about Helm/CRDs and thus focus on the "simple" usecase in terms of end-user convenience, as long as we make sure the choice is documented clearly for those with a more advanced installation.
All in all I think my preference would be the following:
Final concern: for all cases, I've not yet checked how upgrading will go from the current system towards the new one. Have you tested this yet? I'm not sure if/how Helm can deal with CRDs that have previously been installed by the main chart, and might suddenly be claimed by the new CRD chart after applying this. Similarly issues may arise in other options.
(This has become a bit longer that I intended, hopefully I managed to get my main concerns addressed. Make sure to ask me on anything unclear, as I understand this might raise quite a few questions.)
Damn it, that's right. It will break many configuration with the dependency :warning: ! And without the dependency, the install instruction needs to be changed, it won't work out of the box. Even simple blog post with helm install will fail :(.
I'm quite interested in option 2, with doubts ; I'm unsure if the CRDs can be deployed before being used by the dashboard or the healthcheck IngressRoute
.
As you said, it is the most easy for the users, and that's what we want.
We want to keep this and allow advanced users / new features like Gateway API to be more flexible.
=> I'll make some tests on this and open a PR if it looks good.
Many thanks for this review :pray:
Thanks @jnoordsij for your review :pray:
To be honnest, I didn't test to install the chart with CRDs and then upgrade with the one with dependencies. It's very important to validate it before anything else.
That said, for the rest of the concerns, I can understand it but let's summarize the use cases. I see 3 scenarios:
For this, we have multiple solutions, adding your propositions (@jnoordsij):
crd
directory might work. I've checked the ordering and it's good. It can address all scenarios but it will require from us somehow to add big {{ if .Values.addCRDs }}
or {{ if .Values.onlyAddCRDs }}
in all our templates which is, I think, not elegant at allcrd
directory solution).Add the CRDs as templates within the chart like in the cert-manager chart
This morning, I have explored this option. I have encountered two major issues:
IngressRoute
(CRDs are not loaded at this stage)I haven't found a way to switch CRDs from current Helm CRD management to Helm Template management without failure. Instructions can be provided to patch resources beforehand, and thus get around this failure. Maybe it's possible to deploy IngressRoute
in post-install hook, but should we really do this ?
We are really fighting the tide, here.
This use case of selectively picking CRDs is specific. It's clearly not the common use case.
I think we are left with two options on this:
@jnoordsij @darkweaver87 : Wdyt ?
Additional notes:
I think I'm still with option 1 like I was before when explaining my thoughts. CRDs in Helm are just quite complicated at the moment, so I don't think there is a solve-all solution without adjustments on the Helm side. Although managing two charts at once might be complicated for users, if we document matching versions it hopefully should not be to complicated and will provide a way of updating CRDs that is a lot easier then users having to do it manually.
I'm not strongly against option 1, but I think we will clearly lost users on the way. The approach of having a dependency chart seduced me at first because of managing all this compatibility complexity being a responsibility delegated to us. With option 1, we will somehow, have to complete a compatibility matrix for users to know which version of CRD chart comes with which chart version or traefik/traefik-hub version. Even for us, managing a crds will be a nightmare as we will have to maintain a CRD chat and a crds directory. Or, we need to test if symlinks work on charts.
The other option is keeping it that way:
traefik-crds:
traefik: true
However, even with the option 1, the main points remains how users can migrate from the previous system to the new one ? Adding the annotation works but the command I provided is mainly linux friendly :-)
It might be worth checking out how https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack is setup. It bundles https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-operator-crds in but has an option to not install them for when you want to manage them separately. I’ve been using that lately and it works well and isn’t too difficult.
What does this PR do?
This PR introduces a separate chart used by the main one to install CRDs. The dependency between the main chart and the CRDs one will be added once CRDs one will be released.
Motivation
https://github.com/traefik/traefik-helm-chart/issues/1141 https://github.com/traefik/traefik-helm-chart/issues/1209
More
make test
and all the tests passed