Helm
is the package manager for kubernetes, in this tutorial we will set up Helm
on GKE
cluster for
installing charts with Helm
. Below are the steps for installing and set up Helm on GKE
.
Login to Google Cloud Console
Activate Cloud Shell to open Cloud Shell.
Create Cluster on GKE
(Google Kubernetes Engine)
gcloud container clusters create test-cluster --num-nodes 2 --enable-ip-alias --zone us-central1-a
Download Latest Helm
Binary from github
Wget https://get.Helm
.sh/Helm
-v2.16.8-linux-amd64.tar.gz
Unpack downloaded Helm
archive
tar zxfv Helm
-v2.16.8-linux-amd64.tar.gz
Copy Helm
binary to home directory
cp -rp linux-amd64/Helm
~
Get current user account details and save into environment variable
export user_account=$(gcloud config get-value account)
Check value of user_account
echo $user_account
Create clusterrolebinding with cluster-admin role for your user account that is saved in $user_account
kubectl create clusterrolebinding admin-binding --clusterrole=cluster-admin --user=$user_account
For deploying charts with Helm
,
server side of Helm
that is tiller is required,
create tiller service account with name tiller in kube-system namespace
kubectl create serviceaccount tiller --namespace kube-system
For deploying charts kubernetes service account tiller requires cluster-admin role in the cluster,
create clusterrolebinding
for tiller account with below command
kubectl create clusterrolebinding tiller-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
Now initialize Helm
with service account tiller
~/helm init --service-account=tiller
Check Helm
version
~/helm version
Install nginx with Helm
~/helm install --name release-1 stable/nginx-ingress
If you get below error, than upgrade tiller
Error: incompatible versions client[v2.16.8] server[v2.14.1]
Upgrade Tiller with ~/helm init -–upgrade
~/helm init -–upgrade
Try again installing nginx with Helm
~/helm install --name release-1 stable/nginx-ingress
Check running pods
Kubectl get pods
Category: GCP