What Is a Helm Chart? Standardizing Kubernetes Deployment

What Is a Helm Chart? Standardizing Kubernetes Deployment

Kubernetes applications can consist of dozens of YAML files: Deployment, Service, ConfigMap, Secret, Ingress, and more. Managing these files separately for each environment (dev, staging, prod) is error-prone. Helm is a package manager for Kubernetes that bundles these YAML files into parameterized

C

Can Kaya

Security Specialist

March 21, 202612 min read0

Kubernetes applications can consist of dozens of YAML files: Deployment, Service, ConfigMap, Secret, Ingress, and more. Managing these files separately for each environment (dev, staging, prod) is error-prone. Helm is a package manager for Kubernetes that bundles these YAML files into parameterized "charts" for single-command deployment.

What Is Helm and Why Use It?

Helm is a CNCF graduated project and the standard package manager for the Kubernetes ecosystem. It has three core concepts:

Concept Description Analogy
Chart Template package of Kubernetes resources Like an apt/yum package
Release An installed instance of a chart in a cluster Like an installed package
Repository Server where charts are stored Like an apt repository

Helm Chart Structure

terminal
# Create a new chart
helm create my-web-app

# Generated directory structure
my-web-app/
  Chart.yaml          # Chart metadata (name, version, description)
  values.yaml         # Default configuration values
  charts/             # Dependent charts (sub-charts)
  templates/          # Kubernetes YAML templates
    deployment.yaml
    service.yaml
    ingress.yaml
    hpa.yaml
    _helpers.tpl      # Reusable template functions
    NOTES.txt         # Post-install notes shown to user

Parametric Configuration with values.yaml

values.yaml contains all configurable values for the chart. By creating separate values files for different environments, you can use the same chart with different settings across dev, staging, and prod.

values.yaml
replicaCount: 2

image:
  repository: myregistry/web-app
  tag: "v1.2.0"
  pullPolicy: IfNotPresent

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: true
  hostname: app.hosted.cloud
  tls: true

resources:
  requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 500m
    memory: 512Mi

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilization: 60

Using Templates

Helm templates use Go template syntax. Access values.yaml with {{ .Values.xxx }} and the release name with {{ .Release.Name }}.

templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-web
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: {{ .Release.Name }}
  template:
    spec:
      containers:
      - name: {{ .Chart.Name }}
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        resources:
          {{- toYaml .Values.resources | nindent 10 }}

Essential Helm Commands

terminal
# Install a chart
helm install my-release ./my-web-app

# Install with different values file (prod)
helm install my-release ./my-web-app -f values-prod.yaml

# Override values from command line
helm install my-release ./my-web-app --set image.tag=v1.3.0

# Upgrade a release
helm upgrade my-release ./my-web-app -f values-prod.yaml

# Rollback
helm rollback my-release 1

# List installed releases
helm list

# Render template (for debugging)
helm template my-release ./my-web-app -f values-prod.yaml

# Uninstall
helm uninstall my-release

💡 Tip: helm template renders the chart without sending it to the cluster. Use it in CI/CD pipelines to validate YAML output and compare with the current state using kubectl diff.

For Kubernetes fundamentals, check our Introduction to Kubernetes guide. For auto-scaling, see our HPA guide. For continuous delivery with GitOps, read our ArgoCD guide. The official Helm documentation and Artifact Hub (community charts) are valuable additional resources.

Frequently Asked Questions

What's the difference between Helm 2 and Helm 3?

Helm 3 removed the Tiller component, resolving security concerns. Release information is now stored in cluster Secrets. Helm 2 support has ended; all new projects should use Helm 3.

Should I use Kustomize or Helm?

Kustomize is overlay-based, Helm is template-based. For simple environment differences, Kustomize suffices. For complex applications, dependency management, and community charts, Helm is more suitable. They can also be used together.

How do I share a Helm chart?

Package the chart with helm package into a .tgz file. Upload to an OCI registry (Docker Hub, GitHub Packages) or a Helm repository like ChartMuseum. For open-source charts, use Artifact Hub.

Is it safe to store secrets in values.yaml?

No. values.yaml is typically stored in Git, exposing sensitive data. Use the helm-secrets plugin, SOPS, or External Secrets Operator for secrets. Pass sensitive values via --set from your CI/CD pipeline.

Conclusion

Helm Charts are the standard way to package and deploy Kubernetes applications. They provide environment-specific configuration through values.yaml, reusability through template functions, and safe updates through rollback. Learn the chart structure, create environment-specific values files, and integrate into your CI/CD pipeline.

Power Up Your Kubernetes Infrastructure

Run your Helm charts on high-performance Hosted Cloud infrastructure.

Explore Cloud Server Plans →
C

Can Kaya

Security Specialist

CISSP-certified security expert creating content on cybersecurity, DDoS protection, and server hardening.

Comments coming soon