-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
What do you want to happen?
Description:
Currently, Kubebuilder provides support for generating Helm charts to help users package and deploy their operators. This is a great feature and brings real value. However, the current implementation has limitations, especially when changes are made in the config/ directory using Kustomize.
Reference to current implementation:
https://github.com/kubernetes-sigs/kubebuilder/tree/master/pkg/plugins/optional/helm/v1alpha
While the current approach proves that Helm support is possible and useful, it allows us to start discussing and getting feedback from the community about how the chart should be; as add tests to validate to cover its functionalities it is not the easiest to maintain or the best in the long term, especially as the project evolves. Improvements can make this much simpler and more robust.
Proposal:
Update the Helm plugin to:
- Run the same logic that generates the install.yaml from Kustomize (like we already do for make build-installer) bu on the fly:
.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml
- Use the resulting install.yaml as input to generate the Helm chart
- We should still building the chart as it is today
This would make the Helm chart:
- Reflect exactly what’s in the kustomize result from config/
- Allow more customizations via Kustomize and flexibilities
- Reduce manual Helm template maintenance ( if something changes for Golang/Kustomize we need to update the HelmChart templates, if the change impact the for limitations not coming from the templates)
- Solve existing feature requests like: (helm/v1-alpha) --force flag does not update values.yaml when kustomize manager spec has changed #4625
Alternative Proposal
Keep the code as it is, but try to replace the templates with logic to generate the files from config/ instead as much as possible.
Extra Labels
No response