# Deep Dives for helm

## **Introduction**

Deploying an application on Kubernetes usually means writing and managing several YAML files — Deployments, Services, ConfigMaps, Secrets, Ingress, and more. As an application grows, keeping all these files consistent across environments (dev, staging, production) becomes messy and error-prone.

Helm solves this problem. It is the official package manager for Kubernetes — think of it as 'apt' or 'npm', but for Kubernetes applications. Helm packages all your YAML files into a single reusable unit called a Chart, which can be installed, upgraded, or removed with one command.

Tips : If Kubernetes is the operating system, Helm is the app store. Instead of manually writing dozens of YAML files, you just run 'helm install' and your entire application — with all its resources — is deployed in seconds. In this lesson, you'll learn the 4 core building blocks of Helm:

• Helm Charts — the package format that bundles all Kubernetes resources

• Values.yaml — the configuration file that customizes a chart

• Templating — how Helm generates dynamic YAML using variables

• Releases — a tracked, versioned deployment of a chart

Before anything else, install the Helm CLI on your machine:

```plaintext
$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash 
$ helm version 
version.BuildInfo{Version:"v3.15.0", GitCommit:"...", GoVersion:"go1.22"} 
```

## Helm Charts

A Helm Chart is a collection of files that describe a related set of Kubernetes resources. A single chart might deploy something as simple as a Pod, or as complex as a full application stack with a Deployment, Service, Ingress, and database.

Charts are reusable — the same chart can be installed multiple times, with different configurations, across different environments or even different clusters.

Typical Chart Structure

```plaintext
mychart/ 
Chart.yaml          
# Metadata: name, version, description 
values.yaml         
# Default configuration values 
charts/             
# Any dependency charts 
templates/          
# Kubernetes YAML templates 
deployment.yaml 
service.yaml 
ingress.yaml 
_helpers.tpl      
# Reusable template snippets
```

Hands-On:

Create Your First Chart Helm can scaffold a starter chart for you automatically.

```plaintext
$ helm create mychart 
Creating mychart 
$ ls mychart 
Chart.yaml  charts  templates  values.yaml 
```

You now have a fully working chart with sample Deployment and Service templates already wired up — ready to customize.

Hands-On: Install a Chart from a Public Repository You don't always need to write your own chart. Thousands of ready-made charts exist in public repositories:

```plaintext
$ helm repo add bitnami https://charts.bitnami.com/bitnami 
$ helm repo update 
$ helm install my-nginx bitnami/nginx 
NAME: my-nginx 
STATUS: deployed 
REVISION: 1 
```

2\. Values.yaml

What is Values.yaml? values.yaml is the default configuration file for a chart. It defines variables — like image name, replica count, resource limits, or port numbers — that templates use to generate the final Kubernetes YAML.

This is what makes charts reusable: the same chart can behave differently just by changing the values passed to it, without touching the underlying templates.

Example values.yaml

```plaintext
replicaCount: 2 
image: 
repository: nginx 
tag: "1.25" 
pullPolicy: IfNotPresent 
service: 
  type: ClusterIP 
  port: 80 
  
resources: 
  limits: 
    cpu: 200m 
    memory: 256Mi 
```

Hands-On: Override Values at Install Time

You can override any default value directly from the command line using --set:

```plaintext
$ helm install my-nginx bitnami/nginx --set replicaCount=4,service.type=LoadBalancer
```

Or, for larger changes, create your own custom-values.yaml file and pass it in with -f:

```plaintext
$ helm install my-nginx bitnami/nginx -f custom-values.yaml
```

3.Templating

What is Templating? Helm templates are Kubernetes YAML files with placeholders written in Go template syntax. Instead of hardcoding values, templates pull data from values.yaml — so the same template can generate different output for different configurations.

Example Template (deployment.yaml)

```plaintext
apiVersion: apps/v1 
kind: Deployment 
metadata: 
  name: {{ .Release.Name }}-deployment 
spec: 
  replicas: {{ .Values.replicaCount }} 
  template: 
    spec: 
      containers: 
        - name: app 
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 
          ports: 
            - containerPort: {{ .Values.service.port }} 
```

Here, {{ .Values.replicaCount }} is replaced with whatever value is set in values.yaml (or overridden with - set). {{ .[Release.Name](http://Release.Name) }} is automatically filled in with the release name you choose at install time.

Hands-On: Preview Generated YAML Before Installing Always check what YAML a template will actually produce before applying it to a cluster:

```plaintext
$ helm template my-nginx bitnami/nginx --set replicaCount=3 
# Prints the fully rendered Kubernetes YAML to your terminal 
```

You can also do a full dry run against the cluster, without actually creating anything:

```plaintext
$ helm install my-nginx bitnami/nginx --dry-run --debug 
```

4\. Releases

Every time you run 'helm install', Helm creates a Release — a specific, tracked instance of a chart running in your cluster, along with the exact configuration used to deploy it.

Every 'helm upgrade' creates a new revision of that same release, so you always have a history you can go back to.

Hands-On: Manage a Release

List all releases currently running in the cluster:

```plaintext
$ helm list 
NAME       NAMESPACE  REVISION  STATUS    CHART         APP VERSION 
my-nginx   default    1         deployed  nginx-15.5.0  1.25.0 
```

Upgrade a release with new values (e.g. scaling replicas):

```plaintext
$ helm upgrade my-nginx bitnami/nginx --set replicaCount=5 
Release "my-nginx" has been upgraded. Happy Helming! 
REVISION: 2 
```

Check the full revision history of a release:

```plaintext
$ helm history my-nginx 
REVISION  STATUS      CHART         DESCRIPTION 
1         superseded  nginx-15.5.0  Install complete 
2         deployed    nginx-15.5.0  Upgrade complete 
```

Made a mistake? Roll back to any previous revision instantly:

```plaintext
$ helm rollback my-nginx 1 
Rollback was a success! Happy Helming!
```

Remove a release completely when you're done with it:

```plaintext
$ helm uninstall my-nginx 
release "my-nginx" uninstalled 
```

Helm Concepts — At a Glance Here's a quick side-by-side comparison of all four concepts:

![](https://cdn.hashnode.com/uploads/covers/6677b62516ab41c6833574a1/07099b0a-e108-4f35-a225-adebc4dae458.png align="center")

A quick real-world analogy:

• Chart = a recipe

• Values.yaml = the ingredient list you can customize (more salt, less sugar)

• Templating = the cooking instructions that adapt based on the ingredients chosen

• Release = the actual dish served on your table, with a record of every time you re-cooked it.

## **Practical Checklist & Troubleshooting Commands**

you'll actually reach for once Helm is part of your daily workflow:

1\. Validate a chart's syntax before installing:

```plaintext
$ helm lint mychart
```

2\. See exactly what YAML will be generated:

```plaintext
$ helm template mychart 
```

3.Check the status and details of a running release:

```plaintext
$ helm status my-nginx
```

4.Get the values currently in use for a release:

```plaintext
$ helm get values my-nginx
```

5.Clean up a chart you were just testing:

```plaintext
$ helm uninstall my-nginx
```

## **Common Issues You'll Run Into**

![](https://cdn.hashnode.com/uploads/covers/6677b62516ab41c6833574a1/67653c5c-073f-4b3b-8c70-6a3416950d14.png align="center")

Why Helm Matters in Production

As applications grow past a handful of YAML files, managing raw manifests by hand becomes unsustainable. Helm is the standard tool DevOps teams use to keep deployments consistent, repeatable, and safe to change.

• One chart can be reused across dev, staging, and production with different values • Every deployment is versioned — mistakes can be rolled back in seconds

• Thousands of production-ready charts already exist for popular software (databases, monitoring, ingress controllers)

• Teams stop copy-pasting YAML and start sharing standardized, tested charts.
