Basic usage of helm command
What is Helm?
Helm is a package manager for Kubernetes that allows you to manage Kubernetes resources as a single unit called a chart. A chart is a collection of YAML files that define a set of Kubernetes resources. Helm can install, upgrade, and delete charts, making it a powerful tool for managing Kubernetes applications.
How Does Helm Work?
Helm works by using a client-server architecture. The Helm client runs on your local machine and communicates with the Tiller server, which runs inside your Kubernetes cluster. When you run a Helm command, the client sends a request to the Tiller server, which then deploys the resources defined in the chart.
One of the most powerful features of Helm is the ability to use Helm Charts. Helm Charts are pre-configured packages that contain all the Kubernetes resources needed to run a specific application. This saves developers a lot of time since they don’t have to manually configure each resource for every deployment.
Benefits of Using Helm
Helm offers several benefits that make it an essential tool for Kubernetes developers. First, it helps to simplify the deployment of complex applications by bundling related resources into a single package. This reduces the risk of errors and saves time. Second, Helm allows you to create reusable packages that can be easily shared with other developers. Finally, Helm makes it easy to upgrade and rollback applications, ensuring that you can quickly respond to any issues that arise.
Get started
alias helm="helm --kubeconfig=$HOME/tmp/kubeconfig.yaml"
## or put config into "$HOME/.kube/config"
Add repo
helm repo add bitnami https://charts.bitnami.com/bitnami
Search
helm search repo bitnami
Warm up commands
helm repo update
helm repo list
helm install bitnami/mysql --dry-run
helm install bitnami/mysql --generate-name
helm show chart bitnami/mysql
helm list
helm list --all
helm uninstall mysql-1612624192
helm status mysql-1612624192
helm search hub
helm search repo
helm install happy-panda bitnami/wordpress
helm status happy-panda
helm show values bitnami/wordpress
helm get hooks
helm get manifest
helm get notes
helm get values
helm get all
helm env
Upgrade & rollback
helm get values happy-panda
echo 'mariadb.auth.username: user1' > panda.yaml
helm upgrade -f panda.yaml happy-panda bitnami/wordpress
helm get values happy-panda
helm rollback happy-panda 1
helm history happy-panda -n default
Package sources
The helm install command can install from several sources:
- A chart repository (as we’ve seen above)
- A local chart archive (helm install foo foo-0.1.1.tgz)
- An unpacked chart directory (helm install foo path/to/foo)
- A full URL (helm install foo
https://example.com/charts/foo-1.2.3.tgz
)
helm lint web-ping
helm repo add stable https://charts.helm.sh/stable
helm install --set service.type=LoadBalancer --set service.externalPort=8008 --set env.open.DISABLE_API=false repo stable/chartmuseum --version 2.13.0 --wait
helm repo add local $(kubectl get svc repo-chartmuseum -o jsonpath='http://{.status.loadBalancer.ingress[0].*}:8008')
# pack
helm package web-ping
# upload zip
curl --data-binary "@web-ping-0.1.0.tgz" $(kubectl get svc repo-chartmuseum -o jsonpath='http://{.status.loadBalancer.ingress[0].*}:8008/api/chart s')
# check index
curl $(kubectl get svc repo-chartmuseum -o jsonpath='http://{.status.loadBalancer.ingress[0].*}:8008/index.yaml')
helm repo update
helm search repo web-ping
Reference
https://helm.sh
- Learning Helm (Matt Butcher, Matt Farina, and Josh Dolitsky)
https://artifacthub.io
- Learn Kubernetes in a Month of Lunches (ELTON STONEMAN)
- Get helm:
https://github.com/bpbpublications/Kubernetes-for-Jobseekers/blob/main/get_helm.sh