site/content/en/docs/contrib/helm-addons.md
Minikube supports creating addons that are deployed via Helm charts. This allows for more complex applications to be managed as addons. This guide will walk you through creating a Helm-based addon.
For a general overview of creating addons, please see the Creating a new addon guide first. This guide focuses on the specifics of Helm-based addons.
Creating a Helm-based addon is very similar to creating a standard addon, with a few key differences in how the addon is defined.
pkg/minikube/assets/addons.goThe core of a Helm-based addon is the HelmChart struct within your Addon definition. You will define your addon in pkg/minikube/assets/addons.go.
Here is an example of what a Helm-based addon definition looks like:
"my-helm-addon": NewAddon(
[]*BinAsset{}, // Usually empty for pure Helm addons
false,
"my-helm-addon",
"Your Name",
"",
"path/to/your/addon/docs.md",
map[string]string{
// Optional: Define images for caching if not in the chart
},
map[string]string{
// Optional: Define registries for images
},
&HelmChart{
Name: "my-helm-addon-release",
Repo: "oci://my-repo/my-chart",
Namespace: "my-addon-namespace",
Values: []string{
"key1=value1",
"key2=value2",
},
ValueFiles: []string{
// Paths to values files inside the minikube VM
},
},
),
HelmChart struct fields:Name: The release name for the Helm installation (helm install <release-name>).Repo: The Helm chart repository URL (e.g., stable/chart-name or oci://my-repo/my-chart).Namespace: The Kubernetes namespace to install the chart into. The --create-namespace flag is always used.Values: A slice of strings for setting individual values via --set (e.g., key=value).ValueFiles: A slice of strings pointing to paths of YAML value files inside the minikube VM. These are passed to Helm with the --values flag.When the addon is enabled, minikube will automatically ensure the helm binary is installed within the cluster and then run helm upgrade --install with the parameters you have defined. When disabled, it will run helm uninstall.
pkg/addons/config.goTo make your addon visible to minikube addons list and enable it to be managed, you need to add an entry for it in pkg/addons/config.go.
{
name: "my-helm-addon",
set: SetBool,
callbacks: []setFn{EnableOrDisableAddon},
},
To test your new addon, rebuild minikube and enable it:
make && ./out/minikube addons enable my-helm-addon
You can then verify that the Helm chart was deployed correctly using kubectl.
kubectl -n my-addon-namespace get pods