Working With Helm in Kubernetes

Pinterest LinkedIn Tumblr

Helm is a package manager for kubernetes. It provides the same features that rpm or apt provides to linux for Kubernetes.


Helm is porovided as a single binary

Grab the latest release here https://github.com/helm/helm/releases.

I am using v3.5.2 for this guide.

Creating a new chart

# Create new chart in called app
helm create app

# Create new chart in sources dir
helm create sources/app

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

Adding a helm repo:

helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update

# 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 tala-iac/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-url argument to specify the new repository:

    helm init --stable-repo-url https://charts.helm.sh/stable --service-account tiller
  • Use the –skip-refresh argument 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.

I am a Devops Engineer, but I would describe myself as a Tech Enthusiast who is a fan of Open Source, Linux, Automations, Cloud and Virtualization. I love learning and exploring new things so I blog in my free time about Devops related stuff, Linux, Automations and Open Source software. I can also code in Python and Golang.

Write A Comment