Skip to content

Latest commit

 

History

History
152 lines (103 loc) · 2.74 KB

h.helm.md

File metadata and controls

152 lines (103 loc) · 2.74 KB

Managing Kubernetes with Helm

  • Note: Helm is part of the new CKAD syllabus. Here are a few examples of using Helm to manage Kubernetes.

Helm in K8s

Creating a basic Helm chart

show

helm create chart-test ## this would create a helm 

Running a Helm chart

show

helm install -f myvalues.yaml myredis ./redis

Find pending Helm deployments on all namespaces

show

helm list --pending -A

Uninstall a Helm release

show

helm uninstall -n namespace release_name

Upgrading a Helm chart

show

helm upgrade -f myvalues.yaml -f override.yaml redis ./redis

Using Helm repo

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]

Download a Helm chart from a repository

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

Write the contents of the values.yaml file of the bitname/node chart to standard output

show

helm show values bitnami/node

Install the bitnami/node chart setting the number of replicas to 5

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