fluent / fluent/fluent-operator
helm: Re-factor the way we handle CRDs in fluent-operator's helm chart(s)
- Dominant language
- Go
- Stars
- 682
- Forks
- 328
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 13
Description
### Is your feature request related to a problem? Please describe.
How we currently handle CRDs:
* We currently distribute fluent-operator's CRDs in two separate "sub-charts" which are [dependencies](https://github.com/fluent/fluent-operator/tree/master/charts/fluent-operator/charts) of the "main" chart.
* This makes it difficult to upgrade Helm releases when there are CRD changes, because CRDs (in `crds/` directories) are not upgraded by default in Helm. Users have to manually fetch CRDs, run `kubectl replace` etc
* The usage of `file://` references in dependencies also causes duplicate CRDs in the release as reported [here](https://github.com/fluent/fluent-operator/issues/1709).
### Describe the solution you'd like
I'd like to propose that we implement something similar to how [Karpenter](https://github.com/aws/karpenter-provider-aws/tree/main/charts) handles their Helm releases:
* Include the `fluentd` and `fluent-bit` CRDs in the fluent-operator's "main" chart's `crds/` folder.
This will ensure all CRDs get installed during an initial helm install
* Create a new "top-level" chart named `fluent-operator-crds`
* Put CRDs in the `templates/` directory of the `fluent-operator-crds` chart
* Placing them in the `templates/` directory will allow a user to helm upgrade the `fluent-operator-crds` chart to upgrade our CRDs instead instead of having to fetch them manually and `kubectl replace` etc
* In this setup, we'll need to publish updated CRDs to two locations -- `charts/fluent-operator/crds` and `charts/fluent-operator-crds/templates` -- but this should be fairly simple with CI. (edited)
### Additional context
I don't think this would introduce any breaking changes:
* Currently, if a user wants to install fluent-operator without any CRDs, they can set `fluentd.crdsEnable` or `fluentbit.crdsEnable` to false
* Moving forward, we would deprecate these two values, and a user could simply use helm install --skip-crds` if they want to prevent CRD installation
As part of this, we can also clarify and update our documentation for "installing" and "upgrading."
Contributor guide
Assessment
This issue has not been assessed yet.