HELM

What is helm ?

Helm is a package manager for Kubernetes that helps you define, install, and manage Kubernetes applications. It simplifies the deployment of complex Kubernetes resources by bundling them into reusable packages called charts.

Helm architecture

Helm CLI:

  • The command-line interface used by developers or operators to interact with Helm.
  • Responsible for operations like installing, upgrading, or rolling back releases.
helm install my-release my-chart
helm upgrade my-release my-chart
helm rollback my-release

Helm Charts: A Helm chart is a package that contains Kubernetes resource definitions (YAML files) and templates.

Chart Repository

  • A location where Helm charts are stored and shared.
  • Public repositories like Artifact Hub host popular charts (e.g., Bitnami, NGINX).
helm repo add bitnami https://charts.bitnami.com/bitnami
helm search repo bitnami

Release:

  • An instance of a Helm chart deployed in a Kubernetes cluster.
  • Release states are stored in the cluster (as ConfigMaps or Secrets).

Kubernetes API Server: Executes Helm operations by creating or modifying Kubernetes resources.

Create a helm chart: helm create <my-app>

first we have to create helm chart, then we can update the values inside the helm chart directory

To install the application we can run : helm install <app-name> <folder-name>

To check the app which is running in helm: helm list -a

To uninstall the helm chart: helm uninstall <my-app>

To update anything in the file, we can update and run the command: helm upgrade <my-app> <my-app>

If we faced some issue in our application and want to roll back then: helm rollback <my-app> <revision-id>

To debug and dry run before installing app: helm install <my-app> –debug –dry-run <folder-name>

To verify any misconfiguration in the chart: helm lint <my-app>

Customize the chart

Edit values.yaml and change image name and service type

Then go to the Template and edit deployment.yml

Helm file

We can used helm file to install the application and uninstall the application in single command: helmfile sync

---
releases:
  - name: helloworld
    chart: ./helloworld
    installed: true 
for uninstall we can mention false

Helm repo

helm search hub wordpress

Why Helm ?

Helm is a Kubernetes package manager that simplifies application deployment and management by packaging resources into reusable charts. It allows you to:

  1. Simplify Deployments: Use pre-configured templates instead of managing multiple YAML files.
  2. Centralize Configurations: Update settings easily via the values.yaml file.
  3. Enable Rollbacks: Roll back to previous versions with a single command.
  4. Reuse and Share: Share reusable charts across teams or use community charts.
  5. Streamline Updates: Upgrade deployments effortlessly.

Use same app with different environment

Create different values.yaml like dev-values.yaml, stage-values.yaml and prod-value.yaml
Create namespace for dev, stage and prod
Install app with different environment
helm install <app-name> . -f dev-values.yaml -n dev

Leave a Comment