❤️ ABS is one of the five Certified Kubernetes Service Providers in India ❤️

 

In this blog we talk about 

  • Why Helm Charts?
  • Application overview 
  • How to implement Helm charts in Kubernetes cluster 
  • Helm chart model 
  • Benefits of Helm charts

     

Why Helm Charts?

Helm is a package manager for Kubernetes that allows you to define, install, and upgrade even the most complex Kubernetes applications. Helm charts are pre-configured templates that describe how a Kubernetes application should be deployed. By utilizing Helm charts, you can ensure that your application’s deployment is repeatable, scalable, and easily manageable.


The Application Overview:

Our application consists of the following components:

  • 1 Front-end service: The user interface for our web application.
  • 6 Back-end microservices: These microservices handle various aspects of our application’s logic.
  • 3 Databases: To store and manage data.




How We Did It:

1. Chart Structure:

We started by defining a Helm chart structure that would represent our application. Inside the chart directory, we organized our resources into subdirectories, including templates for services, deployments, and other Kubernetes objects.

2. Values File:

We created a values.yaml file to parameterize our chart. This file allows us to customize our deployments, such as configuring the number of replicas, specifying image versions, and defining environment variables.

3. Templates:

Each component of our application had its respective templates. These templates made use of Helm’s templating engine to generate Kubernetes manifests with dynamic values from the values.yaml file.

4. Testing and Validation:

Before deploying to production, we thoroughly tested our Helm chart on a development cluster. This helped us iron out any issues and verify that our application components were working as expected.

5. Release and Upgrades:

Deploying a new version of our application became a breeze. We simply updated the values.yaml file to specify the new image versions and any other configuration changes. Then, we used Helm commands to upgrade our release.

Here you can download our chart:

Click here to download Chart

Helm chart model:
We had created the above Helm chart using the following steps :

  1. Create Helm Chart Structure:
       Use helm create my-app to generate a directory structure for your Helm chart.
  2. Organize Chart Components:
       Place component YAML files in the templates directory, define default values in values.yaml, and include dependencies in the charts directory.
  3. Define Kubernetes Resources:
       Create YAML files for each component in the templates directory.
  4. Parameterize Values:
       Use Helm templating with {{ .Values.variable }} to replace hardcoded values in YAML files.
  5. Create Chart Readme:
       Write a README with installation and configuration instructions.
  6. Package the Chart:
       Use helm package my-app to create a .tgz packaged chart.
  7. Create Helm Repository:
       Host your repository with an index.yaml listing chart versions.
  8. Publish the Chart:
       Upload the chart and index.yaml to a public location with read access.
  9. Install the Chart:
       Add your Helm repository with helm repo add, then install with helm install my-app my-repo/my-app.

Benefits of a Single Helm Chart:

  1. Simplified Management: Our entire application deployment can be managed as a single entity, reducing complexity and human errors.
  2. Version Control: Helm allows us to version-control our chart and track changes over time.
  3. Scalability: Scaling individual components is easy by adjusting replica counts in the values.yaml file.
  4. Portability: The Helm chart can be shared and reused across different clusters or environments.
  5. Efficiency: Updates, rollbacks, and maintenance tasks are streamlined and can be executed with a single command.

Conclusion:

Using a single Helm chart to deploy a complex application on a Kubernetes cluster significantly simplifies the process. With clear chart structure, parameterized values, and well-defined templates, managing and scaling your application becomes a breeze. In our case, this approach streamlined the deployment of one front-end, six back-end microservices, and three databases into a cohesive, manageable unit.

In the world of Kubernetes, simplification is a valuable asset, and Helm charts provide an effective way to achieve it. By sharing our experience, we hope to inspire others to explore the power of Helm charts and embrace the simplicity they can bring to Kubernetes deployments.