Helm is a package manager for kubernetes. It provides the same features that rpm or apt provides to linux for Kubernetes.
Installing
Helm is porovided as a single binary
Grab the latest release here https://github.com/helm/helm/releases.
I am using v3.13.0 for this guide. You can confirm which version you have using this command:
$ helm version
version.BuildInfo{Version:"v3.13.0", GitCommit:"825e86f6a7a38cef1112bfa606e4127a706749b1", GitTreeState:"clean", GoVersion:"go1.21.1"}
Creating a new chart
To create a new chart, use the helm create command. In this example, we are creating a chart named app. We can also create a chart in a directory by providing a path.
# Create new chart in called app
helm create app
# Create new chart in sources directory
helm create sources/app
The created helm chart will come with default
Edit the values in the yml file to reflect your requirements.
To package the charts, use this command:
helm package app
helm package sources/app
To add an existing helm repository, use this command:
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
And update to pull the latest helm updates
helm repo update
To add an existing helm repository that is protected by a password:
# with password
helm repo add --username admin --password secret citizix http://museum.dev.citizix.com
Useful chart commands
# List available repos
helm repo list
# Varify helm chart with this
helm lint app/
# Create index file
helm repo index .
# index the repo
helm repo index --url https://etowett.github.io/helm-charts/ .
# Do git housekeeping
git add . && git commit -m "Added helm chart - jobs " && git push origin master
# Validate things are working as expected
helm upgrade -i --debug --dry-run nginx
helm upgrade -i --debug --dry-run postgres ./app -f ../provision/data/postgres.yaml -n data
# List charts
helm search repo -l
helm search repo jenkins -l
helm search repo jenkins
helm fetch citizix/app
Pushing helm charts to a repo
# Install the plugin
helm plugin install https://github.com/chartmuseum/helm-push.git
helm push app/ citizix
Deleting helm repo:
helm repo remove citizix
Resolving https://kubernetes-charts.storage.googleapis.com is not a valid chart repository in helm 2
Helm versions prior to 2.17.0 have the deprecated https://kubernetes-charts.storage.googleapis.com/index.yaml as the default stable repository, which no longer resolves. The new repo is https://charts.helm.sh/stable. You can choose to:
- Use the -
-stable-repo-urlargument to specify the new repository:
helm init --stable-repo-url https://charts.helm.sh/stable --service-account tiller
- Use the
--skip-refreshargument and replace the stable repo:
helm init --client-only --skip-refresh
helm repo rm stable
helm repo add stable https://charts.helm.sh/stable<
- Upgrade helm to 2.17.0 or later.