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
edit
option to sync the Helm chart. - IMPORTANT: If you have created a webhook or an API using the DeployImage plugin,
you must run the
edit
command with the--force
flag 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 init
subcommand and the edit
subcommand:
# Initialize a new project with helm chart
kubebuilder init --plugins=helm/v1-alpha
# 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]
) -
init (
$ kubebuilder init [OPTIONS]
)
Affected files
The following scaffolds will be created or updated by this plugin:
dist/chart/*