- Note: Helm is part of the new CKAD syllabus. Here are a few examples of using Helm to manage Kubernetes.
show
helm create chart-test ## this would create a helm
show
helm install -f myvalues.yaml myredis ./redis
show
helm list --pending -A
show
helm uninstall -n namespace release_name
show
helm upgrade -f myvalues.yaml -f override.yaml redis ./redis
show
Add, list, remove, update and index chart repos
helm repo add [NAME] [URL] [flags]
helm repo list / helm repo ls
helm repo remove [REPO1] [flags]
helm repo update / helm repo up
helm repo update [REPO1] [flags]
helm repo index [DIR] [flags]
show
helm pull [chart URL | repo/chartname] [...] [flags] ## this would download a helm, not install
helm pull --untar [rep/chartname] # untar the chart after downloading it
Add the Bitnami repo at https://charts.bitnami.com/bitnami to Helm
show
helm repo add bitnami https://charts.bitnami.com/bitnami
show
helm show values bitnami/node
show
To achieve this, we need two key pieces of information:
- The name of the attribute in values.yaml which controls replica count
- A simple way to set the value of this attribute during installation
To identify the name of the attribute in the values.yaml file, we could get all the values, as in the previous task, and then grep to find attributes matching the pattern replica
helm show values bitnami/node | grep -i replica
which returns
## @param replicaCount Specify the number of replicas for the application
replicaCount: 1
We can use the --set
argument during installation to override attribute values. Hence, to set the replica count to 5, we need to run
helm install mynode bitnami/node --set replicaCount=5