Helm helps us to build a framework for clearly defined microservices, and manages our scalability needs (up or down), and assists in adding more Kubernetes nodes and pods to the cluster as needed. Instead of working with a holistic image, and increasing resources, you are running only a necessary set of images, and independently scaling them up.

  • Deployment Speed: A Helm map can quickly be deployed into a Kubernetes cluster. Either pull down a GitHub project with the Helm chart that you are planning to deploy, or give the Chart name from the desired Helm repository. The Consul-Helm repository can be pulled from GitHub, or from the default Helm repository hosted by Google.
  • Application Testing: You’re not alone in this - engineers have built Helm maps to guide you. Like any engineer with testing in mind, they expect failure, and design around it. You’ll appreciate the amount of tests available in several of the Helm map repos. The tests can range from proper load-testing, to simple config testing, to ensure that your services run properly.

What Are The Prerequisites For Installing And Using Helm?

  • A Kubernetes version 1.8 + cluster, enabled with Role-Based Access Control (RBAC).
  • The command-line tool kubectl installed on your local machine, configured to connect with your cluster. More information on installing kubectl can be found in the official documentation.

The following command can test your connectivity:

kubectl cluster-info

Copy

If you see no errors, you’re connected to the cluster. If you access multiple clusters with kubectl, be sure to verify that you’ve selected the correct cluster context:

kubectl config get-contexts

Copy

Your output should look like:

CURRENT   NAME          CLUSTER           AUTHINFO

* do-nyc1-k8s-example   do-nyc1-k8s-exam  do-nyc1-k8s-example-admin

   docker-for-desktop   docker-for-desktop-cluster docker-for-desktop

Copy

In this example the asterisk (*) indicates that we are connected to the do-nyc1-k8s-example cluster.

LAB: Creating A Kubernetes Deployment Using Helm Charts:

1. Installing Helm

First, we’re going to install the Helm command-line utility on our local host. Helm provides a script that will handle the MacOS, Windows, or Linux installation process.

Change to a writable directory, and download the GitHub repository script from Helm:

cd /tmp

curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > install-helm.sh

Copy

Make the script executable with chmod:

chmod u+x install-helm.sh

Copy

You can use your favorite text editor at this point to open the script, and inspect it to make sure it’s safe.

If you’re satisfied with it, run the following:

./install-helm.sh

Copy

Next, you’ll be prompted to provide your password.

2. Installing A Helm Chart

Packages of Helm software are called charts. Helm comes pre-configured with a collection of curated charts called a stable. In their GitHub repos, you can search all of the available charts. Next, as an example, we’ll be installing the Kubernetes Dashboard.

Use Helm to install kubernetes-dashboard from the stable repo package:

helm install stable/kubernetes-dashboard --name dashboard-demo

Copy

Output
NAME:  dashboard-demo
LAST DEPLOYED: Wed Aug 8 20:11:07 2018
NAMESPACE: default
STATUS: DEPLOYED

. . .

Copy

Note the line NAME, highlighted in the output of the above example. In this case the name dashboard-demo was specified. That is our release name - a Helm release is a single one-chart deployment, with a specific configuration. With that map you can deploy several releases, each with its own configuration.

If you don’t use the —name to specify your own release name, Helm will create a random name for you.

#devops #kubernetes #helm

Kubernetes Deployment With Helm Charts
1.75 GEEK