This article will guide you on how to install helm in kubernetes cluster. You might be aware that Helm is the package manger that can be deployed in kubernetes.
Using Helm you can deploy application and manage them easily.To read more about the helm please follow this link.
To show case the demo, we are going to install helm version 2 so that later may be we can see other post which can guide us on how to migrate to helm version 3.
Steps:
- Create the service account required.
# kubectl create serviceaccount --namespace kube-system tiller serviceaccount/tiller created
- Create the cluster role binding in the cluster.
# kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller clusterrolebinding.rbac.authorization.k8s.io/tiller created
- Download the helm binaries and extract it. In this case we are installing helm version 2.16.9
# wget https://get.helm.sh/helm-v2.16.9-linux-amd64.tar.gz # tar -zxvf helm-v2.16.9-linux-amd64.tar.gz # cd linux-amd64/ # ls -ltr total 78672 -rwxr-xr-x 1 root root 39919616 Jun 16 14:17 helm -rwxr-xr-x 1 root root 40615936 Jun 16 14:20 tiller -rw-r--r-- 1 root root 3444 Jun 16 14:20 README.md -rw-r--r-- 1 root root 11343 Jun 16 14:20 LICENSE
- Now move the helm binary to /usr/local/bin
# mv helm /usr/local/bin/helm
- Check the version of the helm.
# which helm /usr/local/bin/helm # helm version Client: &version.Version{SemVer:"v2.16.9", GitCommit:"8ad7037828e5a0fca1009dabe290130da6368e39", GitTreeState:"clean"} Error: could not find tiller # helm version --short Client: v2.16.9+g8ad7037
- Initialize the helm using helm init command as below.
# helm init --service-account tiller Creating /root/.helm Creating /root/.helm/repository Creating /root/.helm/repository/cache Creating /root/.helm/repository/local Creating /root/.helm/plugins Creating /root/.helm/starters Creating /root/.helm/cache/archive Creating /root/.helm/repository/repositories.yaml Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com Adding local repo with URL: http://127.0.0.1:8879/charts $HELM_HOME has been configured at /root/.helm. Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster. Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy. To prevent this, run `helm init` with the --tiller-tls-verify flag. For more information on securing your installation see: https://v2.helm.sh/docs/securing_installation/
- Cross check that tiller is running fine in the kubernetes using below command.
# kubectl -n kube-system get pod,deploy|grep -i tiller pod/tiller-deploy-8488d98b4c-9xpbg 1/1 Running 0 14s deployment.apps/tiller-deploy 1/1 1 1 14s
- Once you see that tiller is running fine fire helm list command to cross verify. In the beginning it will show blank output.
# helm list
Some other commands to cross verify your helm:
# helm search jenkins NAME CHART VERSION APP VERSION DESCRIPTION stable/jenkins 2.1.0 lts Open source continuous integration server. It supports mu... # helm home /root/.helm # helm version --short Client: v2.16.9+g8ad7037 Server: v2.16.9+g8ad7037 # helm repo list NAME URL stable https://kubernetes-charts.storage.googleapis.com local http://127.0.0.1:8879/charts
In case you want to install jenkins use below command:
# helm install stable/jenkins
Once installed you can list down it using below helm list command:
# helm list NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE khaki-kitten 1 Thu Jun 25 02:05:27 2020 DEPLOYED jenkins-2.1.0 lts default
So this is all about “How to install helm” in kubernetes and cross-verify it for successful installation.
Leave a Reply