Helm Plugin (helm/v1-alpha)
The Helm plugin is an optional plugin that can be used to scaffold a Helm chart, allowing you to distribute the project using Helm.
By default, users can generate a bundle with all the manifests by running the following command:
make build-installer IMG=<some-registry>/<project-name:tag>
This allows the project consumer to install the solution by applying the bundle with:
kubectl apply -f https://raw.githubusercontent.com/<org>/project-v4/<tag or branch>/dist/install.yaml
However, in many scenarios, you might prefer to provide a Helm chart to package your solution.
If so, you can use this plugin to generate the Helm chart under the dist directory.
When to use it
- If you want to provide a Helm chart for users to install and manage your project.
- If you need to update the Helm chart generated under
dist/chart/with the latest project changes:- After generating new manifests, use the
editoption to sync the Helm chart. - IMPORTANT: If you have created a webhook or an API using the DeployImage plugin,
you must run the
editcommand with the--forceflag to regenerate the Helm chart values based on the latest manifests (after runningmake manifests) to ensure that the HelmChart values are updated accordingly. In this case, if you have customized the files underdist/chart/values.yaml, and thetemplates/manager/manager.yaml, you will need to manually reapply your customizations on top of the latest changes after regenerating the Helm chart.
- After generating new manifests, use the
How to use it ?
Basic Usage
The Helm plugin is attached to the edit subcommand as the helm/v1-alpha plugin
relies on the Go project being scaffolded first.
# Initialize a new project
kubebuilder init
# Enable or Update the helm chart via the helm plugin to an existing project
# Before run the edit command, run `make manifests` to generate the manifest under `config/`
make manifests
kubebuilder edit --plugins=helm/v1-alpha
Subcommands
The Helm plugin implements the following subcommands:
- edit (
$ kubebuilder edit [OPTIONS])
Affected files
The following scaffolds will be created or updated by this plugin:
dist/chart/*
