Custom Search

Sunday, May 19, 2019

How to Install Helm and Create Helm Chart on Ubuntu

0)
Verify the status of kubernetes cluster
kubectl get nodes
#
kubectl get pods --all-namespaces
#
kubectl cluster-info
#
kubectl config get-contexts

1)
download the script from Helm's GitHub repository:

$ cd /tmp
$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > install-helm.sh

2)
Make the script executable
$ chmod u+x install-helm.sh

3)
#Install helm
$ ./install-helm.sh

4)
Installing Tiller
Tiller is a companion to the helm command that runs on your cluster, receiving commands from helm and communicating directly with the Kubernetes API to do the actual work of creating and deleting resources. To give Tiller the permissions it needs to run on the cluster, we are going to make a Kubernetes serviceaccount resource.

#Create the tiller serviceaccount:
$ kubectl -n kube-system create serviceaccount tiller

#bind the tiller serviceaccount to the cluster-admin role:
$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller

# Now we can run helm init, which installs Tiller on our cluster, along with some local housekeeping tasks such as downloading the stable repo details:
$ helm init --service-account tiller

#To verify that Tiller is running, list the pods in thekube-system namespace:
$ kubectl get pods --namespace kube-system

#Now that we've installed both Helm components, we're ready to use helm to install our first application.

5)
Installing a Helm Chart

#Use helm to install the kubernetes-dashboard package from the stable repo:
$ helm install stable/kubernetes-dashboard --name dashboard-demo

#We can ask Helm for a list of releases on this cluster:
$ helm list

# We can now use kubectl to verify that a new service has been deployed on the cluster:
$ kubectl get services

1 comment:

  1. When I try to install tiller helm init, I am getting an error error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository

    ReplyDelete