Welcome!
Talend Workshop on Helm
Welcome to the Helm for beginners workshop!
In this workshop you will learn how to:
- Install Helm Server
- Add a chart registry and fetch a chart
- Install a chart in a k8s cluster
- Upgrade and rollback release
- Manage chart dependencies
- Manage tags and conditions
and something more ... :-)
Congratulations!
You've completed the scenario!
Scenario Rating
Congratulations! You've completed Helm Katacoda scenario!
More details can be found on Helm's website http://www.helm.sh/
Your environment is currently being packaged as a Docker container and the download will begin shortly. To run the image locally, once Docker has been installed, use the commands
cat scrapbook_sgandon_helm_container.tar | docker load
docker run -it /sgandon_helm:
Oops!! Sorry, it looks like this scenario doesn't currently support downloads. We'll fix that shortly.

Steps
Talend Workshop on Helm
Step 1 - Install Helm Server
Helm Client should already be installed.
please check it is a version higher that 3.0
helm version
if this is not the case try to execute
./get_helm.sh
and check the version again.
Step 2 - Add charts registry and fetch chart
In this step you will add a chart registry to your Helm installation.
Task
Let's look first at what registries are available from our Helm client:
helm repo list
The list should be empty.
Now let's add a repository to our Helm client. Copy the following command and paste it into the terminal:
helm repo add talend https://sgandon.github.io/katacoda-scenarios/
Execute again helm repo list
and see the new talend
registry in the list.
You can now list the charts from your talend
registry:
helm search repo talend
If you want to find out what else helm repo
can do, execute the following command:
helm repo --help
Now that you have added talend
registry to your Helm client let's fetch the chart hello-world
from this registry.
This chart packages the same application you have worked with in the Kubernetes workshop.
Before you download the chart, let's look at some details of this chart (version, app version, description):
helm search repo talend/hello-world
Use the following command to fetch the hello-world
chart and in the same time unpack it in the current folder:
helm fetch --untar talend/hello-world
The command above has created a hello-world
folder inside the current folder.
Step 3 - Install chart
In this step you will install the hello-world
chart in the k8s cluster.
Task
Helm provides two commands which are recommended to be used before installing a chart:
helm lint
checks the formatting of the manifest fileshelm --debug --dry-run
simulates an install. The flag "--debug
" displays the output of the install in the console.
Let's execute these commands and check their output:
helm lint hello-world
helm install hello-world ./hello-world --debug --dry-run
The chart is now ready to be installed. Every time a chart is installed, Helm will need a release name to be specifed. Let's use helm-training
as our release name:
helm install helm-training ./hello-world
List all Helm/k8s applications/releases with the following command:
helm ls
Please note the columns REVISION, CHART and APP VERSION.
You can also see the resources deployed by a release with the following command:
helm status helm-training
Check the status of pods to see when the application has been full deployed. If you don't remember the command take a look at the solution below.
Solution
kubectl get pods -w
When the hello-world
pod is running find out the service port exposed by k8s (the port will be in the range 30000-32767):
kubectl get --namespace default -o jsonpath='{.spec.ports[0].nodePort}{"\n"}' services helm-training-hello-world
In the upper side of the terminal (title bar) you have a tab called "Display 8080
". Click on it and a new tab will open in your browser. The URL will have the following format: https://177078276-8080-599693266-training1.environments.katacoda.com/
but the application will not work. Replace 8080
in the host name with the port displayed by the previous command. The hello-world welcome page will appear which confirms that the application is up and running in the k8s cluster.
Let's move to the next step and see how we can perform an upgrade and a rollback on the Helm release.
Step 4 - Upgrade and rollback release
In this step you will learn how to upgrade and rollback a Helm release.
Task
You will start by checking the number of running pods:
kubectl get pods
At this stage only one pod is running.
Open the file hello-world/values.yaml
and change the value replicaCount
from 1 to 3.
Then open the file hello-world/Chart.yaml
and change the field version
from 0.1.0 to 0.1.1.
You are now ready to upgrade the Helm release that you created in the previous step.
helm upgrade helm-training hello-world
Check again the release information by executing:
helm ls
You can see that the fields REVISION and CHART have been modified. This means that you should have now three pods running. Check that again:
kubectl get pods
To view the full release history, execute the following command:
helm history helm-training
Let's see now what happens if we rollback to revision 1:
helm rollback helm-training 1
Execute again helm history helm-training
. The REVISION field is incremented to 3 but the chart version is the same as in revision 1.
You should now also have only one pod running:
kubectl get pods
You have successfuly upgraded and rollbacked a release. Now you can delete the release before we move to the next step:
helm delete helm-training
This command removes the release and all k8s objects belonging to it.
Step 5 - Chart dependencies
In this step you will learn how to check for chart dependencies and how to update chart dependencies.
Task
Let's fetch the chart
talend-infrastructure
from the talend
registry and untar it. Try to do this on your own before you check the solution below. But don't feel discouraged if you can't. :-)
Solution
helm fetch --untar talend/talend-infrastructure
For the purpose of learning about dependencies let's rename the folder talend-infrastructure/charts
to talend-infrastructure/subcharts
:
mv talend-infrastructure/charts talend-infrastructure/subcharts
To check if the chart can be installed, simulate an install and display the output in the terminal. Use
infra
as Helm Release name.
Solution
helm install infra ./talend-infrastructure --debug --dry-run
Right, the chart is missing dependencies! You can list the chart's dependencies with the following command:
helm dep ls talend-infrastructure
Take a look at talend-infrastructure/Chart.yaml
to see where and how dependencies are defined. All dependencies should have been in the talend-infrastructure/charts
folder but, of course, they don't exist because we deleted that folder.
Let's recreate the talend-infrastructure/charts
folder by updating the chart's dependencies:
helm dep up talend-infrastructure
And now look again at the talend-infrastructure/charts
folder.
You can now proceed to install the chart
talend-infrastructure
with the release name infra
in k8s. Do you remember the command for installing a chart?
Solution
helm install infra ./talend-infrastructure
Unfortunately that install has not installed anything, by default, the infrastructure chart doesn't create any objects. You will have to explicitly set which infrastructure service you want to create. This can be done through tags and/or conditions which we are going to tackle down in the next step.
However, even if the installed did not install anything, Helm has created a release which we need to delete.
Try to list existing releases and delete the
infra
one.
Solution
helm ls
helm delete infra
Step 6 - Tags and conditions
In this step you will learn about tags and conditions, which are a means to enable and disable chart dependencies.
Task
The talend-infrastructure
chart has nine dependencies and by default they are all disabled.
Look again at talend-infrastructure/Charts.yaml
and especially pay attention to the fields condition
and tags
.
Then look at talend-infrastructure/values.yaml
to see the default values for the tags. The condition global.infra.enabled
is not defined at all.
Default values can be overriden at install time either by specifying a new values file with the -f
parameter or
by specifying an new individual value with the --set
parameter.
Let's enable the talend-redis
dependency by using the --set
parameter:
helm install infra ./talend-infrastructure --set tags.talend-redis=true
Alternatively, you can use a new values file as follows:
helm install infra ./talend-infrastructure -f values-standalone.yaml
Check the status of the release with helm ls
. Redis is now up and running inside the k8s cluster.
Do you remember how to check what pods are available in k8s? What about how to attach to a pod and run a command?
Attach to the redis pod and run the command
redis-cli ping
. You should receive a pong
message back.
Solution
kubectl get pods
kubectl exec -it $(kubectl get --no-headers=true pods -l app=infra-redisembedded -o custom-columns=:metadata.name) redis-cli ping
Note: the $(...) command is just a way to discover dynamically the pod name that is randomly set.
You can now delete the
infra
release.
Solution
helm delete infra
Congratulations, you have finished your Helm workshop!