docs / articles / Helm Deployment Template Example

Helm Deployment Template Example

Noah Aug 16, 2026 2026-08-16 04:58:21

In the dynamic world of Docker orchestration, Helm plays a pivotal role in managing Kubernetes applications. It streamlines the process of discovering, sharing, and using software from a catalog of packaged Kubernetes applications known as charts. Today, we'll explore a comprehensive guide on Helm, focusing on deployment templates with an illustrative example.

Elegant Helm Template For Rails Project
Elegant Helm Template For Rails Project

Before delving into the specifics, let's quicken the pulse of things. Helm is a package manager for Kubernetes, enabling you to find, share, and use software built for Kubernetes. Now, let's dive into the depths of Helm deployment templates.

a flow diagram showing the steps to create an action plan for a company's organization
a flow diagram showing the steps to create an action plan for a company's organization

Understanding Helm Deployment Templates

Helm deployment templates are a compelling feature of Helm, enabling you to create reusable, customizable Kubernetes manifests. They serve as a blueprint for your Kubernetes objects, allowing you to specify placeholders (also known as chart parameters) that can be filled with different values depending on the specific environment.

[Kubernetes] Package Manager - Helm 簡介
[Kubernetes] Package Manager - Helm 簡介

These templates empower you to separate the concerns of what your application does (defined in the chart) from where and how it runs (defined in the release). Now, let's look at two crucial aspects of Helm deployment templates - values.yaml and templates.

values.yaml: Customizing Your Deployment

How Helm and JKube simplify Kubernetes management, part 1 | Red Hat Developer
How Helm and JKube simplify Kubernetes management, part 1 | Red Hat Developer

The values.yaml file forms the heart of Helm deployment templates, allowing you to customize your applications' behavior during deployment. It contains a list of key-value pairs, with each key representing a configuration parameter for your application.

For instance, consider a Helm chart of a simple Redis deployment. The values.yaml file might look like this: ```yaml master: enabled: true startup: 30 replicas: 2 ``` This indicates that the Redis master should be enabled, and it should start within 30 seconds. It also specifies that two Redis replicas should be created.

templates: Your Kubernetes Blueprints

27 Free HR Templates to Streamline Every Process
27 Free HR Templates to Streamline Every Process

The templates directory in your Helm chart houses the actual Kubernetes manifests (written in Go templates) responsible for creating, updating, and deleting Kubernetes resources. These templates take in the values defined in values.yaml and generate the final, environment-specific Kubernetes manifests.

Continuing with the Redis example, the templates directory might contain a file named redis-deployment.yaml, which could look like this: ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "mychart.fullname" . }} .spec: replicas: {{ .Values.replicas }} selector: matchLabels: app.kubernetes.io/name: {{ include "mychart.name" . }} template: metadata: labels: app.kubernetes.io/name: {{ include "mychart.name" . }} spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: - name: http containerPort: 80 protocol: TCP ``` This Go template generates a Kubernetes Deployment resource, utilizing the values defined in values.yaml to specify the number of replicas and the container image's repository and tag.

Helm Deployment Template Example: A Simple Redis Application

Web App Clusters Deployment Diagram
Web App Clusters Deployment Diagram

Now that we've discussed the fundamentals of Helm deployment templates, let's create a simple Redis application using Helm. Our chart will consist of a values.yaml file and a redis-deployment.yaml template.

First, create a new directory for your chart and initiate it with Helm using `helm create my-redis-chart`. This command generates a basic Helm chart structure. Replace the contents of values.yaml and redis-deployment.yaml with the examples provided earlier. Then, package your chart with `helm package my-redis-chart`.

a screenshot of a web page with several people on it
a screenshot of a web page with several people on it
a large screen shot of a web page with many different people on it and one person in the background
a large screen shot of a web page with many different people on it and one person in the background
a blue and green background with the words design tieration in white letters on it
a blue and green background with the words design tieration in white letters on it
an advertisement for the company's new website, which is designed to help employees learn how
an advertisement for the company's new website, which is designed to help employees learn how
an image of a web page with the settings section highlighted in black and white colors
an image of a web page with the settings section highlighted in black and white colors
(3) Home / X Process Section Design, Ui Element, Information Layout Design, Infographic Process Design, Banner Ui Design, Form Design Layout, How It Works Web Design, Benefits Section Website Design, Categories Ui Design
(3) Home / X Process Section Design, Ui Element, Information Layout Design, Infographic Process Design, Banner Ui Design, Form Design Layout, How It Works Web Design, Benefits Section Website Design, Categories Ui Design
tech features website layout
tech features website layout
Jira Service Desk | IT Service Desk & ITSM Software | Atlassian
Jira Service Desk | IT Service Desk & ITSM Software | Atlassian
a black and white business plan with three options for each section, including the words action plan
a black and white business plan with three options for each section, including the words action plan

Deploying Your Helm Chart

With your Helm chart packaged, you can deploy it to your Kubernetes cluster using the following command: ```bash helm upgrade --install my-redis-release /path/to/my-redis-chart-0.1.0.tgz ``` This command upgrades the existing release named my-redis-release (or installs it if it doesn't exist) with the chart at the specified path, using the values defined in values.yaml.

In conclusion, Helm deployment templates offer a powerful way to customize and manage Kubernetes applications. By leveraging values.yaml and templates, you can create flexible, reusable Kubernetes manifests ready to be deployed to various environments. Start exploring Helm deployment templates today and elevate your Kubernetes application management to new heights!