Repository navigation
feat: Add support for a crds/ directory - #6243
Conversation
Closes helm#5871 Signed-off-by: Matt Butcher <[email protected]>
|
/cc @mattfarina who is on a boat right now when he should be reviewing my PRs. |
mattfarina
left a comment
There was a problem hiding this comment.
As follow-ups...
- We need to finish creating the legacy plugin
- We should experiment with a crd plugin to diff and update crds. A plugin or many of them is a good way to experiment future capabilities
thomastaylor312
left a comment
There was a problem hiding this comment.
I paired with @technosophos on this and we ran it through its paces, so this is an LGTM from me
|
Merging as @technosophos is currently unavailable. |
|
@technosophos @mattfarina @thomastaylor312 Should we add a page to the documentation for CRD support and strategy in Helm 3? Pretty much pull the description from here. |
|
@hickeyma Yep, that would be a good idea |
|
I've opened #7735 to discuss some of the assumptions made around upgrading/patching CRDs in this PR - I'd appreciate feedback 😄 Notably:
I disagree with - there is an accepted practice, and it is up to CRD authors to follow this closely. (although it's probably best to centralise discussion in #7735) 😄 |
|
Calling out this particular section of the original post for my future reference:
This behaviour is still true today. i.e. If a new Helm chart version adds/introduces a new CRD and you then attempt to upgrade your existing chart to that new version via |
What this PR does / why we need it: This PR adds support for a
crds/directory into which you may put your CRDs without fear.Closes #587
This PR adds support for a
crds/directory in a chart. During chart install (and ONLY during install), it reads the contents of that directory and attempts to install those files before it renders the rest of the chart.In a sense, it is a pre-install. It provides a way to add CRDs before the rest of the chart so that things that need CRDs can install them before instances of those CRDs can be created by the chart.
If a CRD is already found in the cluster, Helm will skip installing that CRD and will log this to the debug log. It will neither error out nor see if there are any differences between its version and the existing version.
This behavior can be turned off with
--skip-crds.Things this feature does NOT do:
helm installorhelm upgrade. There is no accepted practice for managing CRD upgrades (again, because they are a global resources, and an upgrade can break things in interesting ways), so we decided not to handle this case. It is up to the operator.helm templateorhelm OP --dry-run. We could add this in the future, or add a separate command for printing CRDs. For example, we could create ahelm crd some_chartmay print the CRDs for that chart. Feedback welcome.crd-installhook is still NOT added back to Helm 3. This is an alternative that we believe is much more robust and safe. (I was the author ofcrd-install, and I am very dissatisfied with it.)To Get Started
templates/andcharts/namedcrds/.templates/that use those CRDshelm install test-crds $YOURNEWCHARTYou should see your CRDs with
kubectl get crds. The chart should succeed even if it references those CRDs.Special notes for your reviewer:
If applicable: