Helm Charts — Quick Tips for Kick Starts — OpsInsights

Helm Charts — Quick Tips for Kick Starts — OpsInsights

Technology is always ahead of us and it is tough to follow up with.

Yes, when I tend to know about Docker, there were already superstars like Docker Swarm and Kubernetes. Docker evolves and lets others automate, so comes docker swarm. No, let’s do another way Kubernetes says, I will manage everything even scaling, you just do maintenance and deployments.

No end to this story and we are here to discuss Helming. Helm is the manager/driver for Kubernetes. We can manage k8s using helm clients.

What is a helm? It is a light client to manage k8s management. Let us discuss more with our first helm chart.

Installing helm: There are two parts of installing helm; One was with Tiller (Helm server) and Helm (client)

You can install helm using the below command, based on your OS distro. https://helm.sh/docs/using_helm/

Sample helm chart:

  • Navigate to the location where you would like to maintain helm for the app.
  • Execute the following command.
helm init -history-max 200
  • Hmmm, wonder why history max 200, thus helm maintains only 200 revisions of history for the deployment. Meaning that you can roll back up to the last two hundred versions easily.

  • This will install Tiller to your running Kubernetes cluster. It will also set up any necessary local configuration.

helm create $ChartName

-Helm creates initializes the local repository with the list of required templates. |- .helmignore # Contains patterns to ignore when packaging Helm charts. |- Chart.YAML # Information about your chart | |- values.YAML # The default values for your templates | |- charts/ # Charts that this chart depends on | |- templates/ # The template files | |- templates/tests/ # The test files

Let's add all our scripts.

Step-1 : Copy all your scripts to templates directory (deployment/service/ingress/secrets )

Step-2: List down all your used values/variables in values.YAML file.

In my yaml file, I have listed the following.

namespace: sandbox
 replicaCount: 1
 name: jenkins
 image:
 repository: XXX DOCKER REPO XXX
 tag: latest
 pullPolicy: Always
 strategy:
 type: RollingUpdate
 rollingUpdate:
 maxUnavailable: 25%
 maxSurge: 25%
 revisionHistoryLimit: 5

Step-2: Replace hardcoded values with bootstrapped values. as shown below example.

once you have followed the above steps for all your deployment files. do helm install to install your app.

helm install -namespace sandbox Jenkins-app Jenkins/

> jenkins-app > my custom chart name.
> jenkins/ > charts directory.

Helm install will return the output if you have configured any outputs for your easy use; say IP, load balancer name etc. (will discuss this more in helm deep dive post)

to list the available helm packages installed and running in your cluster.

helm ls

And finally, deployments is super easy by the way,

helm upgrade -namespace sandbox jenkins-app jenkins/ -set image.tag=XXXX

if your new image for the app is XXXX just replace the above value with image id.

As simple it is, Did I miss any quick bites from the helm, do comment let's discuss.

Peace!!!

Originally published at https://opsinsights.dev on July 6, 2019.

Did you find this article valuable?

Support OpsInsights.dev by becoming a sponsor. Any amount is appreciated!