Helm Basics: Packaging and Templating Kubernetes Charts
Package manifests into reusable Helm charts, parameterize values with Go templates, and install releases with a single command.
Netbay Developer Relations
Netbay Engineering
On this page
Writing raw manifests works, but once you deploy the same workload in several environments, you want one source of truth with configurable switches. Helm is the package manager for Kubernetes. A chart is a collection of templates plus a values file; installing a chart renders the templates into final manifests and tracks them as a release. Upgrading and rolling back become single commands.
Chart anatomy
A chart is a directory with a specific layout: Chart.yaml describes metadata, values.yaml holds default configuration, and templates/ holds Go-template files that render to YAML.
myapp/
Chart.yaml
values.yaml
templates/
deployment.yaml
service.yamlA templated deployment
Templates reuse a lot of boilerplate and substitute values with template expressions. Common helpers include .Values.name and .Release.Name.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${ .Values.name }
namespace: ${ .Values.namespace }
spec:
replicas: ${ .Values.replicas }
selector:
matchLabels:
app: ${ .Values.name }
template:
metadata:
labels:
app: ${ .Values.name }
spec:
containers:
- name: app
image: "${ .Values.image.repository }:${ .Values.image.tag }"
resources:
requests:
cpu: ${ .Values.resources.cpu }The backslash escapes the dollar so the file stays a valid template literal; Helm sees the expression and substitutes the value at render time.
The values file
values.yaml supplies the defaults that the templates read.
name: myapp
namespace: default
replicas: 2
image:
repository: nginx
tag: "1.27"
resources:
cpu: 100mRendering and installing
Preview what Helm will render, then install or upgrade it. The workflow is dry-run first, then apply.
helm template myapp ./myapp
helm install myapp ./myapp --namespace production
helm list --namespace production
helm upgrade myapp ./myapp --set image.tag=1.26
helm rollback myapp 1The --set flag overrides values without editing the file, which is handy for throwaway changes.
How templating composes into a release
When to reach for Helm
Helm shines for installing third-party components with many options and for shipping your own multi-resource apps. For a tiny static manifest, the extra abstraction is overkill — pick it when the config surface is genuinely variable.
Takeaway
Helm turns a pile of manifests into a versioned, parameterized chart you can install, upgrade, and roll back in one command each. Templates handle variation; values.yaml keeps defaults central. Practice by charting one of your k3s apps on a Netbay VPS, then use helm install to redeploy it cleanly anywhere — netbayhosts.in.
Keep reading
Follow along on a real VPS
Deploy Linux in under 60 seconds
These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.
Deploy an instance