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