Creating a Release in Helm

1 hour
  • 5 Learning Objectives

About this Hands-on Lab

In this hands-on lab we will be working with release versions of charts in Helm.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Update the Page Index in `nginx/values.yaml`, Set the Service to `NodePort` with an External Port of `30080`, and Increment the Version Number in `nginx/Chart.yaml`

Locate the nginx chart that is in the home directory:

[cloud_user@host]$ cd ~
[cloud_user@host]$ ls -l

Modify the index contents found in the values.yaml file (with whatever editor you like — we’re using Vim here with vim ./values.yaml:

index: >-
##insert your html here##

Set the service to NodePort and the HTTP port to 30080. The entry should match this:

service:
  annotations: {}
  clusterIP: ""
  externalIPs: []
  loadBalancerIP: ""
  loadBalancerSourceRanges: []
  type: NodePort
  port: 8888
  nodePort: "30080"

Set a version number in Charts.yaml. Edit it (with something like vim ./Chart.yaml) and update the value for version.

Initialize and Patch Helm

Initilize helm using the following command.

helm init

Once helm is initilized patch it into the kube sytem using the following command.

kubectl patch deploy --namespace kube-system tiller-deploy -p'{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
Release the Chart and Confirm the Version Number of the Released Chart

Release the chart:

[cloud_user@host]$ cd ~
[cloud_user@host]$ helm install nginx

Once that command has completed, run two commands. This returns the release name:

[cloud_user@host]$ helm ls --short  

Look at the chart name for the version on this one.

[cloud_user@host]$ helm history <release name>

Obtain the IP address of one of the cluster nodes other than the master and navigate to the IP:Port in a web browser http://(node_IP)"30080"

Confirm that the index page is correct.

Update the Index Data in the ./nginx/values.yaml File and Increment the Version Number in Charts. Upgrade the Release and Verify the New Version

Update the contents of the index as done previously
Increment the version number of the Chart.yaml file as done previously
Upgrade the release.
helm init
helm ls –short <– this returns the release name
helm upgrade (release name) ~/nginx

Verify the new verison of the release by checking the chart name in the helm history

 helm history (release name)

Load the index page and confirm the content is correct.

Rollback the Release to the Previous Version and Confirm that the Correct Version is Now Deployed

Get the available revisions for the helm release

 helm ls --short  <- this returns the release name
 helm history (release name)

locate the revision number that has the chart version that contains the first version you created.

helm rollback (release name) (revision number)
helm history (release name)  <-- verify the correct version is listed as "deployed"

Allow the pods volumes to update and check the web page content, it should be the first change you made.

Additional Resources

In this Hands-On Lab, we will look at the process of versioning releases in Helm. There is a simple chart that we will modify and then release. Once the release has been verified as working, we will update the release and then verify that the changes have been published. Finally we will roll back the release to the original state that we first published, and then confirm that the rollback was successful.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?