On the road again

The article shows how to install and use k8s Helm charts.

wget https://storage.googleapis.com/kubernetes-helm/helm-v2.12.3-linux-amd64.tar.gz
tar zxvf helm-v2.12.3-linux-amd64.tar.gz
mv ./linux-amd64/helm /usr/bin
From now "helm help" command should work.
Initialize help and install Tiller into kubernetes cluster defined in kubectl config:
helm init --history-max 200
After this you`ll see Tiller in the list of pods in kube-system namespace.
Working with repos and charts:
helm repo list  ###list of repos enabled
helm search ###search repositories for charts
helm inspect stable/mysql ###retrieve detailed information about certain chart
helm install --name my-db-1 stable/mysql ###install selected chart with specified release name. 
 NOTE: if the command above resulted in "namespace default is forbidden" you may want to run following commands to configure RBAC:
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
 Adding repo:
helm repo add dev https://example.com/dev-charts
Adding local repo:
helm repo add local http://localhost:8879/charts
Install chart with custom parameters:
Prepare yaml file with parameters:
cat ./mysql_config.yml:
mysqlRootPassword: <some_password>
mysqlUser: <some_user>
mysqlPassword: <some_password>
mysqlDatabase: testdb​
helm install -f ./mysql_config.yml --name mysql-db-1 stable/mysql
View parameters:
helm get values mysql-db-1
Upgrade/rollback installed chart:
helm upgrade -f ./mysql_config.yml mysql-db-1 stable/mysql
View release history:
helm history mysql-db-1
Rollback to certain release version:
helm rollback mysql-db-1 1 ###"1" is a release version taken from the result of previous command
Delete chart:
helm delete mysql-db-1
Download chart from repository to current local directory:
helm fetch dev/keystone
Добавить комментарий