Helm installation and Best practices
What is Helm?
Package manager for Kubernetes. Basically the ability to package YAML files and distribute them to other users and apply them in the cluster(s).
As a concept it’s quite common and can be found in many platforms and services. Think for example on package managers in operating systems. If you use Fedora/RHEL that would be dnf. If you use Ubuntu then, apt. If you don’t use Linux, then a different question should be asked and it’s why? but that’s another topic :)
Why do we need Helm? What would be the use case for using it?
Sometimes when you would like to deploy a certain application to your cluster, you need to create multiple YAML files/components like: Secret, Service, ConfigMap, etc. This can be tedious task. So it would make sense to ease the process by introducing something that will allow us to share these bundle of YAMLs every time we would like to add an application to our cluster. This something is called Helm.
Helm installation
Please find below url for intsllation of helm for your envionment.
https://helm.sh/docs/intro/install/
ex:
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
$ chmod 700 get_helm.sh
$ ./get_helm.sh
Explain “Helm Charts”
$ helm init
Helm Charts is a bundle of YAML files. A bundle that you can consume from repositories or create your own and publish it to the repositories.
Explain the Helm Chart Directory Structure
wordpress/
Chart.yaml # A YAML file containing information about the chart
values.yaml # The default configuration values for this chart
charts/ # A directory containing any charts upon which this chart depends.
templates/ # A directory of templates that, when combined with values,
Create the Installing the Chart .
a. helm create project-name
ex: helm create project-name
b. Add the repo and install from repo
ex: helm repo add azure-samples https://azure-samples.github.io/helm-charts/
helm install azure-samples/aks-helloworld hello-world
what difference between two command . In second command already yaml files existing you just reusing but first coomand you ned to create from begginer.
One more :
helm install vote azure-samples/azure-vote
for uninstall
If you want practice more just follow below repo steps :
some more commands :
How do you list deployed releases?
helm ls
or helm list
How to execute a rollback?
helm rollback RELEASE_NAME REVISION_ID
How to view revision history for a certain release?
helm history RELEASE_NAME
How to upgrade a release?
helm upgrade RELEASE_NAME CHART_NAME