Tutorial: Using Helm to Deploy Redis

Describes how to use the Helm package manager for Kubernetes to deploy Redis. Helm simplifies discovering and deploying services to a Kubernetes cluster.

Step 1: Install Helm

NOTE
If you are using the Kubernetes Web Terminal in HPE Ezmeral Runtime Enterprise, Helm is already installed. Skip to Step 2: Search For Chart.

Helm is a single binary that manages deploying Charts to Kubernetes (link opens an external website in a new browser tab/window). A chart is a packaged unit of Kubernetes software.

Execute the following commands to install Helm:

curl -LO https://storage.googleapis.com/kubernetes-helm/helm-v2.8.2-linux-amd64.tar.gz
tar -xvf helm-v2.8.2-linux-amd64.tar.gz
mv linux-amd64/helm/usr/local/bin/

Once installed, initialize and then update the local cache to sync the latest available packages with the environment by executing the following commands:

helm init
helm repo update

Execute the following command to add the repo:

$ helm repo add bitnami https://charts.bitnami.com/bitnami

Step 2: Search For Chart

You can now start deploying software. You can use the search command. For example, you need to find a Redis chart in order to deploy Redis. You can search for and then inspect Redis by executing the following commands:

helm search repo redis
helm inspect stable/redis

Step 3: Deploy Redis

Execute the following command to deploy the chart to your Kubernetes cluster:

$ helm install my-release bitnami/redis

Helm launches the required pods. You can view all packages by executing the following command:

helm ls

If you receive an error that Helm could not find a ready Tiller pod, this means that Helm is still deploying. Wait a few moments for the Tiller container image to finish downloading.

Step 4: See Results

Helm deploys all the pods, replication controllers, and services. Use kubectl to display what was deployed:

kubectl get all

The pod remains in a Pending state until the container image is downloaded and a persistent volume is available.

kubectl apply -f pv .yaml

Enable write permissions to Redis by executing the following command:

chmod 777 - R /mnt/ data *

When the pod status changes to Running, the Redis cluster is now running on top of Kubernetes.

If desired, you can give a Helm chart a friendly name by executing a command such as:

helm install --name my-release stable/redis