Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Last active March 4, 2022 20:12
Show Gist options
  • Save prashanth-sams/02b560c3ff9270a9b2b019842444e949 to your computer and use it in GitHub Desktop.
Save prashanth-sams/02b560c3ff9270a9b2b019842444e949 to your computer and use it in GitHub Desktop.
Helm Chart Cheatsheet

Install helm

brew install kubernetes-helm

Initialize helm

helm init

Initialize helm [when there is an issue with helm tiller versions]

helm init --service-account tiller --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -

Create endpoint (chart template)

helm create sitespeedio

Search chart repo

search for helm chart from remote repo

helm search <chart-name>
e.g., helm search prometheus

Download remote chart to local

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

for more details: https://github.com/helm/charts/tree/master/stable

Create release

here, sitespeedio is the endpoint created

helm install --name sitespeedio ./sitespeedio/

with namespace

helm install --name sitespeedio . --namespace=sitespeedio

without name [create release with random name]

helm install . --namespace=sitespeedio

Helm chart syntax checker

helm lint

Uninstall tiller from your Kubernetes Cluster

helm reset --force

Version check

helm version
tiller version

Release status

helm status <release-name>
e.g., helm status zooming-fish

List all releases with details

helm ls --all
helm list

with namespace

helm list --namespace=sitespeedio

List release name(s)

helm ls --short

with namespace

helm ls --all --namespace=sitespeedio --short

with status deployed

helm ls --all --namespace=sitespeedio | grep DEPLOYED | awk '{print$1}'

uninstall tiller

helm reset --force

update helm

brew upgrade kubernetes-helm
helm init —upgrade

delete release

helm delete <release-name>
e.g., helm delete zooming-fish

extract and delete release

helm del $(helm ls | grep 'aus' | awk '{print $1}')
helm del $(helm ls | grep 'FAILED' | awk '{print $1}')

delete all releases

helm del $(helm ls --all --short) --purge

force delete helm release

helm delete --purge --no-hooks <release-name>

completely remove release [even from DELETE status]

helm del <release-name> --purge
helm del $(helm ls --all | grep 'DELETED' | awk '{print $1}') --purge
@prashanth-sams
Copy link
Author

set kubeconfig

export KUBECONFIG=~/.kube/config

view kubeconfig

kubectl config view

@prashanth-sams
Copy link
Author

prashanth-sams commented Jan 29, 2020

Inspect the variables in a chart

helm inspect values stable/mysql

Install chart dependency

helm dependency update
helm dep up <chart-name> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment