Learn how to use the Helm, a package manager that helps you managing and deploying applications on OpenShift.
Helm is a package manager for Kubernetes which helps users create templated packages called Helm Charts to include all Kubernetes resources that are required to deploy a particular application. Helm then assists with installing the Helm Chart on Kubernetes, and afterwards it can upgrade or rollback the installed package when new versions are available.
- Helm core concepts
helmcommand line tool
- Deploying and managing
- Creating your own
- Managing applications lifecycle with Helm
- Helm integrations with OpenShift UI
Be able to provide a great experience for both Developers and System Administrators to manage and deploy applications using Helm Charts on top of OpenShift.
Helm Charts are particularly useful for installation and upgrade of stateless applications given that the Kubernetes resources and the application image can simply be updated to newer versions. The follow-up for this Day 1 experience, is to convert Helm Charts into an Operator, using Operator Framework for a complete Day 2 experience for your apps.
This OpenShift cluster will self-destruct in one hour.
Let's get started!
In this workshop, you have worked with OpenShift and learned about how Helm 3 integration helps developers to deploy and run applications.
As follow-up of this workshop, we recommend the Operator SDK with Helm workshop, also available as self-paced lab.
We hope you have found this workshop helpful in learning about Helm on OpenShift, and would love any feedback you have on ways to make it better! Feel free to open issues in this workshop’s GitHub repository.
To learn more about Helm, the resources below can provide information on everything from getting started to more advanced concepts.
Helm Documentation: https://helm.sh
Getting Started with Helm 3 on OpenShift: https://docs.openshift.com/container-platform/latest/cli_reference/helm_cli/getting-started-with-helm-on-openshift-container-platform.html
Read more in the Helm Topic page: https://www.openshift.com/learn/topics/helm/
Getting Started with Helm 3 on OpenShift
Explore Helm CLI
At the end of this chapter you will be able to:
- Search, install and uninstall
- Review Helm Charts from
Helm Command Line Interface (CLI)
In this scenario you will find the Helm CLI already installed for you, which can be also retrieved from OpenShift Console, top right corner, click on ? -> Command Line Tools.
The CLI is the entry point for any interaction with Helm 3 subsystem. In addition to that, OpenShift Developer Catalog, which is the central hub for all developer content, has support for Helm Charts in addition to Operator-backed services, Templates, etc.
When a user instructs the Helm CLI to install a Helm Chart, the information about the Helm Chart is fetched from the repository, rendered on the client and then applied to Kubernetes while a record of this installation is created within the namespace (which is known as a Release).
Logging in to the Cluster
To login to the OpenShift cluster from the Terminal run:
oc login -u developer -p developer
This will log you in using the credentials:
Use the same credentials to log into the Web Console.
Create a new OpenShift Project to have a namespace for our helm charts to work with.
oc new-project helm
Exercise: Explore CLI
Let's get started by using
helm getting CLI version :
This should confirm we are using Helm 3.
As discussed in the previous step, Helm Charts are available through repositories, and those can be pre-installed or installable by the user.
You can search for Helm Charts available in any public repositories through Helm Hub.
For instance, searching Helm Charts for NGINX:
helm search hub nginx
This will give a list of available charts from multiple repositories. If we want to install it, we need to have such repositories configured.
By default the list of available repositories is empty. You can add a new one with the CLI. For NGINX, add Bitnami repository:
helm repo add bitnami https://charts.bitnami.com/bitnami
Once added, verify it is present:
helm repo list
You can search for Helm Charts also inside repos, like in the one you just installed:
helm search repo bitnami/nginx
Deploy a Helm Chart
You can use
helm install command to deploy your charts and start managing revisions.
To install NGINX Chart:
helm install my-nginx bitnami/nginx --set service.type=ClusterIP
This will install
nginx, and for this example, we want to use
ClusterIP Service type because we want to expose it afterwards through an OpenShift
Check your Helm releases:
Verify all the pods are in Running state and Ready:
oc get pods
my-nginx service to access it via OpenShift
oc expose svc/my-nginx
Verify that route has been created:
oc get routes
You can click on the generated host to access the NGINX Pod provided by your just installed Helm Chart, or you can do it from OpenShift Console.
Verify the deployment from OpenShift Console
To verify the creation of the resources generated by the Helm Chart, you can head out to the OpenShift web console.
You can make your way to the web console by clicking on the Console tab next to the Terminal tab at the center top of the workshop in your browser.
You need to log in with username
developer and password
Make sure the Developer perspective from the dropdown in the top left corner of the web console is selected as shown below:
Next, select the Project dropdown menu shown below and choose
helm project you have been working with.
Next, click on the Topology tab on the left side of the web console if you don't see what's in the image below. Once in the Topology view, you can see the Deployment for
my-nginx application and you can access it by clicking on the URL generated by the OpenShift Route:
You'll notice the HR label and Helm icon below, this means that this application is managed by Helm, and you can overview Helm
Releases for this app from left side menu, Helm section:
Resources that are associated with a particular Helm
Release, click on
my-nginx Helm Release and then click on
Uninstall and clean
Come back to Terminal clicking on Terminal tab.
helm uninstall my-nginx
Delete previously created
oc delete route my-nginx