Deimos_Logo_RollOut

How to Deploy Helm Chart to Google Kubernetes Engine

Deimos Fallback Image

Helm is described as a “package manager for Kubernetes”, it is a tool for managing applications that run in the Kubernetes cluster manager while also ensuring you don’t have to manage Kubernetes manifests by hand.

Helm provides a set of operations that are useful for managing applications, such as: inspect, install, upgrade, rollback, delete.

In this tutorial, we would deploy a Helm Chart to a Google Kubernetes Engine Cluster.

Google Kubernetes Engine (GKE) provides a managed environment for deploying, managing, and scaling your containerized applications using Google infrastructure. The Kubernetes Engine environment consists of multiple machines (specifically Google Compute Engine instances) grouped together to form a container cluster.

Prerequisites

For an overview of Kubernetes concepts, see the Kubernetes documentation.

Setup a Google Kubernetes Engine cluster

To set up a GKE cluster, click here OR navigate as follows on the GCP Console:
Kubernetes Engine > Clusters > Create Cluster
(name: my-cluster, leave other fields as is)

GKE cluster creation

If you are more comfortable using the gcloud tool, the equivalent command for the above is:

$ gcloud container clusters create my-cluster

Helm Charts

Helm provides the same basic feature set as many of the package managers you may already be familiar with, such as Debian’s apt, or Python’s pip. Helm can: Install software. Automatically install software dependencies. Upgrade software. Configure software deployments. Fetch software packages from repositories

Helm charts are packages of pre-configured Kubernetes resources that are ready to deploy. It consists of metadata that describes the application, plus the infrastructure needed to operate it in terms of the standard Kubernetes primitives. Each chart references one or more (typically Docker-compatible) container images that contain the application code to be run.

To install Helm v3.X, run the following commands, or check out the docs:

$ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get-helm-3 > get_helm.sh
$ chmod 700 get_helm.sh
$ ./get_helm.sh
You can test this installation by executing:
$ helm version
To add the official Helm stable chart, execute:
$ helm repo add stable https://kubernetes-charts.storage.googleapis.com/
You can list charts on a repository using:
$ helm search repo stable
Adding & Listing Helm Chart Repo

Helm Hub

You can also discover awesome Helm charts which represent Kubernetes applications on Helm Hub. The Hub repository contains the documentation and some configuration for the distributed public repository search hosted by Helm.

Helm Hub UI
Helm Hub

Installing a Chart

You would install a WordPress application using its Helm Chart. You can search for the WordPress Helm Chart and select bitnami/wordpress.

Firstly, you need to add the repository by executing:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
You can then proceed to install the WordPress application with a release name of choice, we’ll be using myblog and also passing custom values for the WordPress username and password.
$ helm install myblog bitnami/wordpress --version 8.1.4 --set wordpressUsername=admin,wordpressPassword=password

 

This sets up a WordPress deployment on your Kubernetes cluster using the Helm package manager, it also packages the Bitnami MariaDB chart which is required for bootstrapping a MariaDB deployment for the database requirements of the WordPress application.

Note that your installed WordPress application name would be in form of *<application_name>-wordpress* .

 

To get the IP address of your deployed application, you can run the command:

$ kubectl get service myblog-wordpress

You can also navigate to Kubernetes Engine > Services & Ingress and see how your application is doing. As seen below.

Monitoring application service on GKE

 

You can also visit the External IP or Login to *<IP>/admin* with the username and password used earlier.

 

Remember that we installed the Chart with the release name myblog , this is a running instance of the Chart and can be installed multiple times with different release names. Helm allows you to delete, upgrade, roll back a Chart release.
Checkout more Helm commands here.

To uninstall an application, you need to run the following command:

$ helm delete myblog

Note that every Kubernetes resource that is tied to this release will be removed.

Conclusion

If you would like to dive deeper into more of what was discussed, the following resources would come in handy:
Return to Top ⟶