OpsCanary
kuberneteshelmPractitioner

Creating Your First Helm Chart: Templates and ConfigMaps

5 min read Official DocsAug 2, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

Helm charts simplify the deployment of applications in Kubernetes, allowing you to manage complex configurations with ease. By creating a Helm chart, you can package your Kubernetes resources, making it easier to deploy and manage them consistently across environments. This article focuses on creating a chart and adding your first template, which is crucial for automating your deployments.

A Helm chart is structured with a specific layout: mychart/Chart.yaml, values.yaml, charts/, and templates/. When you run the command $ helm create mychart, Helm generates this structure for you. The templates directory is where the magic happens. Helm evaluates all the files in this directory using its template rendering engine, collecting the results and sending them to Kubernetes. For instance, you can create a ConfigMap in your template like this:

YAML
1apiVersion: v1
2kind: ConfigMap
3metadata:
4  name: {{.Release.Name}}-configmap
5data:
6  myvalue: "Hello World"

This allows you to dynamically name your ConfigMap based on the release name, which is a best practice in production. However, be cautious with template naming; while there’s no strict pattern, using the .yaml extension for YAML files and .tpl for helpers is recommended. Also, using the --dry-run flag can help test your templates, but it doesn’t guarantee Kubernetes will accept them. Always validate your charts with actual deployments after testing.

Helm version 4.2.3 is the latest, and while it brings improvements, the core concepts of chart structure and template rendering remain essential for effective use. Remember, a well-structured Helm chart can save you time and reduce errors in your deployments, but it requires careful attention to detail and testing.

Key takeaways

  • Understand the structure of a Helm chart: mychart/Chart.yaml, values.yaml, charts/, templates/
  • Use `$ helm create mychart` to generate a new chart structure quickly.
  • Define dynamic ConfigMaps using the release name for better resource management.
  • Utilize the `--dry-run` flag for testing, but validate with actual deployments.
  • Follow naming conventions: use .yaml for YAML files and .tpl for helpers.

Why it matters

In production, managing configurations effectively can prevent deployment failures and streamline updates. Helm charts provide a powerful way to automate and standardize your Kubernetes deployments.

Code examples

prism-code
$ helm create mychart
prism-code
apiVersion: v1 kind: ConfigMap metadata: name: {{.Release.Name}}-configmap data: myvalue: "Hello World"
prism-code
$ helm install --debug --dry-run goodly-guppy ./mychart

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
Better StackSponsor

Unified observability — logs, uptime monitoring, and on-call in one place. Used by 50,000+ engineering teams to ship faster and sleep better.

Try Better Stack free →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.