OpsCanary
kuberneteshelmPractitioner

Creating Your First Helm Chart: Templates and ConfigMaps

5 min read Official DocsJun 14, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

Helm charts are essential for managing Kubernetes applications. They simplify deployment by packaging all necessary resources and configurations into a single unit. This article focuses on creating a Helm chart and adding a template, specifically a ConfigMap, which is crucial for storing configuration data in Kubernetes.

When you create a Helm chart, it follows a structured format: mychart/Chart.yaml, values.yaml, and the charts/templates/ directories. Helm evaluates the chart by sending all files in the templates/ directory through its rendering engine. The results are then sent to Kubernetes for deployment. For example, you can create a chart with the command $ helm create mychart, which sets up the necessary directory structure. After that, you can remove existing templates with $ rm -rf mychart/templates/* and create a new ConfigMap template. An example of a ConfigMap template looks like this:

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

In production, remember that template names don’t have a strict naming pattern, but it’s best to use .yaml for YAML files. The name: field is limited to 63 characters due to DNS constraints, which can affect your release names. Using --dry-run helps test your templates, but it won’t guarantee that Kubernetes will accept them. Always validate your configurations before deploying to avoid runtime issues.

Key takeaways

  • Create a Helm chart using `$ helm create mychart` to set up the directory structure.
  • Remove existing templates with `$ rm -rf mychart/templates/*` to start fresh.
  • Define a ConfigMap in your template to store configuration data effectively.
  • Use `.yaml` extensions for templates to maintain clarity and organization.
  • Test your templates with `--dry-run`, but don’t rely on it for validation against Kubernetes.

Why it matters

Using Helm charts simplifies the deployment of complex applications in Kubernetes, making it easier to manage configurations and updates. This efficiency can significantly reduce deployment time and errors in production environments.

Code examples

prism-code
$ helm create mychart
prism-code
$ rm -rf mychart/templates/*
prism-code
apiVersion: v1 kind: ConfigMap metadata: name: {{.Release.Name}}-configmap data: myvalue: "Hello World"

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.