Managing Apps on GKE using Helm Charts
This article is a based on Kubernetes on GKE : Series Intro , which covers some basics of Google Kubernetes Engine (GKE) and how to setup a cluster.
Helm is described as a “package manager for Kubernetes”, it is a tool for managing applications that run in the Kubernetes cluster manager. Helm provides a set of operations that are useful for managing applications, such as: inspect, install, upgrade and delete. We’ll use Helm to deploy applications to the Google Kubernetes Engine Cluster.
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
The Helm Hub repository contains the documentation and some configuration for the distributed public repository search hosted by Helm.
You would install a Wordpress application using its Helm Chart. You can search for the Wordpress Helm Chart and select bitnami/wordpress.
To add the Bitnami Helm Chart repository that’ll enable use install Wordpress, you need to run the following command:
helm repo add bitnami https://charts.bitnami.com/bitnami
To verify that the repository has been added, run the command:
helm repo list
To install the Wordpress Chart to Helm, run the command:
helm install myblog bitnami/wordpress --version 8.1.4 --set wordpressUsername=admin,wordpressPassword=password
It also packages the Bitnami MariaDB chart which is required for bootstrapping a MariaDB deployment for the database requirements of the WordPress application.
The above command also sets the WordPress administrator account username and password to
password respectively. You can learn more about the Bitnami Wordpress Chart and its configuration parameters here.
To get the IP address of your deployed application, you can run the command:
kubectl get service myblog-wordpress
_Note that this is in the form of <application_name>-wordpress . You can also visit the External IP or Login to <IP>/admin with the username and password used earlier._
You can also navigate to Kubernetes Engine > Services & Ingress and see how your application is doing. As seen below.
To uninstall an application, you need to run the following command:
helm delete myblog
Note that every Kubernetes resource that is tied to that release will be removed.
To learn learn more about Helm, do visit its documentation.