Kubernetes > Helm
Helm is a package manager for Kubernetes
Helm deploys package releases based on charts
Charts refer to a combination of associated Kubernetes objects such as Pods, Controller objects(ReplicaSets, Deployments), Services
To install helm
nwcode $ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
To initialize helm
nwcode $ helm init
To update the chart repository
nwcode $ helm repo update
To search for a chart
nwcode $ helm repo search <searchterm>
To search for charts containing nginx in their names or descriptions
nwcode $ helm search nginx
NAME CHART VERSION APP VERSION DESCRIPTION
stable/nginx-ingress 1.7.0 0.24.1 An nginx Ingress controller that uses ConfigMap to store ...
stable/nginx-ldapauth-proxy 0.1.2 1.13.5 nginx proxy with ldapauth
stable/nginx-lego 0.3.1 Chart for nginx-ingress-controller and kube-lego
stable/gcloud-endpoints 0.1.2 1 DEPRECATED Develop, deploy, protect and monitor your APIs...
To view more information about a package
helm info <chartname>
helm inspect <chartname>
To view more information about stable/nginx-ingress chart
nwcode $ helm info stable/nginx-ingress
nwcode $ helm inspect stable/nginx-ingress
To install stable/nginx-ingress chart on the cluster
nwcode $ helm install stable/nginx-ingress
To search for charts containing jenkins in their names or descriptions
nwcode $ helm search jenkins
NAME CHART VERSION APP VERSION DESCRIPTION
stable/jenkins 1.3.2 lts Open source continuous integration server. It supports mu...
To install stable/jenkins chart on the cluster
nwcode $ helm install stable/jenkins
To view the list of charts in the Kubernetes cluster
nwcode $ helm ls
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
measly-jellyfish 1 Wed Jun 26 09:13:15 2019 DEPLOYED nginx-ingress-1.7.0 0.24.1 default
messy-horse 1 Wed Jun 26 09:18:13 2019 DEPLOYED jenkins-1.3.2 lts default
The helm package names above were given randomly by Helm but these names can also be given manually, to make it more meaningful
To install stable/jenkins chart with a user defined name
nwcode $ helm install --name stable-jenkins-release stable/jenkins
To check the list of jenkins packages
nwcode $ helm ls | grep jenkins
messy-horse 1 Wed Jun 26 09:18:13 2019 DEPLOYED jenkins-1.3.2 lts default
stable-jenkins-release 1 Wed Jun 26 09:36:05 2019 DEPLOYED jenkins-1.3.2 lts default
We see there are 2 different Jenkins packages both holding the same chart
The chart would have installed set of Kubernetes objects
To view all the deployed objects
nwcode $ kubectl get all
To view the deployed objects associated with the nginx-ingress chart
nwcode $ kubectl get all | grep nginx
pod/measly-jellyfish-nginx-ingress-controller-69dcdcf4c8-bdt95 1/1 Running 0 13m
pod/measly-jellyfish-nginx-ingress-default-backend-97545f694-64472 1/1 Running 0 13m
service/measly-jellyfish-nginx-ingress-controller LoadBalancer 10.102.208.96 <pending> 80:30357/TCP,443:31188/TCP 13m
service/measly-jellyfish-nginx-ingress-default-backend ClusterIP 10.103.118.235 <none> 80/TCP 13m
deployment.apps/measly-jellyfish-nginx-ingress-controller 1/1 1 1 13m
deployment.apps/measly-jellyfish-nginx-ingress-default-backend 1/1 1 1 13m
replicaset.apps/measly-jellyfish-nginx-ingress-controller-69dcdcf4c8 1 11 13m
replicaset.apps/measly-jellyfish-nginx-ingress-default-backend-97545f694 1 11 13m
We see there are 2 Pods, 2 Services, 4 Controllers (2 Deployments, 2 ReplicaSets)
These were all deployed with just a single helm install command
We can also search for charts with the web browser, by visting https://hub.helm.sh/
For example we can search for Spinnaker charts, the resulting url would be https://hub.helm.sh/charts?q=spinnaker
By clicking on that chart link, we would see the complete info of the spinnaker chart and instructions to install it
To install a package with spinnaker chart
$ helm install --name stable-spinnaker-release stable/spinnaker
--end-of-post--