✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Helm

Helm is a package manager for Kubernetes that simplifies deploying and managing containerized applications.

Helm is a package manager for Kubernetes that simplifies the deployment, configuration, and management of applications running on Kubernetes clusters. It enables users to define, install, and upgrade complex Kubernetes applications using reusable and versioned packages called charts. Helm abstracts the intricacies of Kubernetes YAML manifests by templating and parameterizing configurations, making it easier to manage infrastructure as code and automate application lifecycle operations.


Helm Fundamentals

Helm Charts

A Helm chart is a collection of files that describe a related set of Kubernetes resources. It includes templates for Kubernetes manifests combined with default configuration values. Charts are versioned packages that can be shared and reused, allowing developers and operators to deploy applications consistently across different environments.

Chart Structure

A typical Helm chart contains:

  • Chart.yaml: Metadata about the chart, including name, version, description, and dependencies.
  • values.yaml: Default configuration values that can be overridden at install or upgrade time.
  • templates/: Directory containing Kubernetes manifest templates written using the Go templating language.
  • charts/: Optional subcharts or dependencies integrated within the main chart.
  • README.md: Documentation for the chart usage.
  • Additional files like LICENSE, NOTES.txt for post-install instructions.

Helm Releases

When a chart is installed on a Kubernetes cluster, Helm creates a release. A release is a specific deployment instance of a chart with a particular configuration. Helm tracks release versions, enabling rollback and upgrade capabilities.


Helm Architecture

Client-Server Model

Helm operates primarily as a client-side tool that interacts with the Kubernetes API server. Earlier versions of Helm used a server-side component called Tiller, but modern Helm (v3 and above) has removed Tiller for improved security and simplicity, operating entirely client-side with direct Kubernetes API communication.

Release Management

Helm stores release metadata and resource manifests inside Kubernetes Secrets or ConfigMaps in the cluster. This storage allows Helm to manage the lifecycle of each release, supporting operations like install, upgrade, rollback, and uninstall.

Template Engine

Helm uses Go templates to dynamically generate Kubernetes manifests based on user-supplied values and chart defaults. This templating supports control structures, functions, and pipelines, enabling complex configurations and reusable logic within charts.


Helm Operations

Installing Charts

Users deploy applications by running helm install, specifying a chart and optionally overriding default values. Helm renders the templates using the effective configuration, then applies the resulting manifests to the Kubernetes cluster.

helm install my-release stable/nginx

Upgrading Releases

Upgrades apply new chart versions or updated configurations to an existing release. Helm performs a three-way diff between the last deployed manifests, the new manifests, and the live cluster state to apply changes safely.

helm upgrade my-release stable/nginx --set replicaCount=3

Rollbacks

If an upgrade causes issues, Helm allows rolling back to a previous release version, restoring the cluster state to a known good configuration.

helm rollback my-release 1

Uninstalling Releases

Releases can be removed from the cluster using helm uninstall, which deletes all Kubernetes resources associated with the release.

helm uninstall my-release

Chart Development

Creating Charts

Developers can scaffold new charts using the helm create command, which generates a basic chart structure to customize.

helm create mychart

Customizing Templates

Chart maintainers write templates using Go templating syntax to define Kubernetes resources dynamically. They can use conditionals, loops, and helper templates to create flexible deployments.

Managing Dependencies

Helm supports chart dependencies declared in Chart.yaml. Dependencies are automatically fetched and packaged, enabling modular chart design and version control.


Chart Distribution and Repositories

Charts can be packaged into .tgz archives and stored in Helm chart repositories, which are HTTP servers that index available charts. Users can add repositories, search for charts, and install them directly.

helm repo add stable https://charts.helm.sh/stable
helm repo update
helm search repo nginx

Kubernetes Integration

Helm is tightly integrated with Kubernetes, leveraging its API to deploy and manage resources. It respects Kubernetes RBAC and uses kubeconfig for authentication and authorization. Helm charts encode best practices for Kubernetes resource definitions and lifecycle management.


Helm Security

Helm v3 eliminated the server-side Tiller component to reduce attack surface and simplify security. Helm supports signing and verifying charts to ensure integrity and authenticity. Role-based access control (RBAC) rules govern Helm's permissions on the Kubernetes cluster.


Helm Extensibility and Automation

Helm supports hooks to run custom jobs during release lifecycle events (install, upgrade, delete), enabling flexible workflows. It integrates with CI/CD pipelines and GitOps tools, automating deployment and rollback processes.

Helm plugins extend functionality with additional commands and integrations, enhancing Helm's capabilities to fit diverse operational needs.


Helm Compatibility

Helm supports Kubernetes clusters from version 1.14 and later, ensuring compatibility with modern Kubernetes APIs and features. Charts specify Kubernetes API versions and resource requirements to maintain portability and stability across environments.


Helm is a powerful tool that standardizes Kubernetes application deployment and management, improving developer productivity, operational consistency, and application lifecycle control in cloud-native environments.

Content in this section