Skip to main content
We designed a clean repository with base and overlay directories, but the base YAML files remain static. Many values are hard-coded. If you need the same application deployed to three environments with different replica counts, images, and resource limits, what do you do? The naive approach is copy-and-paste—but that doesn’t scale. In this lesson you will:
  • Understand why copy-and-paste configuration breaks at scale.
  • Learn how Helm templates and Kustomize overlays provide parameterization.
  • Compare Helm and Kustomize and when to pick each.
  • See how both integrate with GitOps tools like Argo CD and Flux for continuous delivery.
Why copy-and-paste configuration is a problem Imagine a platform team managing three microservices across three environments (dev, staging, prod). For each service and environment they kept separate Deployment, Ingress, and Service manifests. That produces many near-identical files. A single setting change (for example a health-check path) requires editing many files, increasing the chance of mistakes.
A slide-sized diagram titled "Copy-Paste Configuration" showing a platform infrastructure split into three environment columns (Dev, Staging, Dev), each containing Patient Service, Appointment, and Payment sections. Each service box contains multiple microservice instances labeled "ms" with numeric IDs, illustrating replicated deployments across environments.
In a real incident, an engineer updated 24 of 27 files; three manifests for the staging payment service were missed. Staging health checks failed silently for two weeks because the alerting channel was archived. The root cause: managing infrastructure through copy-and-paste YAML created drift between environments. Small edits (change image tag, replicas, probe path) become error-prone and time-consuming. Auditing differences across many almost-identical files is difficult.
A presentation slide titled "Copy-Paste Configuration" showing four colorful boxes listing problems: Drift between environments, Tedious updates, Hard to audit differences, and Human error. Each box includes a short example (e.g., "Fix applied to prod but not staging," "Change image tag in 3+ places," "What's actually different between envs?," "Typos, missed files, inconsistent naming").
YAML by itself is static YAML is a data format, not a programming language. Kubernetes manifests are static documents — they don’t have variables, conditionals, or loops.
A presentation slide titled "YAML Has No Variables" with a YAML document icon. It explains that Kubernetes manifests are static and that YAML is a data format, not a programming language, with no variables, conditionals, or loops.
YAML anchors and aliases offer limited reuse, but only inside a single file or a YAML stream. They don’t support external references, conditionals, or environment-specific parameterization.
A slide titled "YAML Has No Variables" explaining that YAML anchors and aliases exist but only work within a single file and can't reference external values, shown as two illustrated cards. The slide includes a KodeKloud copyright at the bottom.
Use an external tool Two dominant approaches solve multi-environment parameterization:
  • Helm — a templating engine that generates Kubernetes YAML from templates and values.
  • Kustomize — a patching system that declares small environment overlays on top of valid base YAML.
Both have different philosophies. Choose the right tool for your use case. Helm (templating) Helm uses Go templates. You author manifests as templates with placeholders like {{ .Values.replicas }} and provide environment-specific values in YAML files. Example chart layout:
Example template (templates/deployment.yaml):
Example values files: values.yaml (defaults)
values-prod.yaml
Render the templates with:
Helm strengths:
  • Rich templating language (variables, loops, conditionals).
  • Large ecosystem of packaged charts on Artifact Hub.
  • Chart packaging, versioning, and dependency management.
Helm challenges:
  • Go template syntax can be terse and non-intuitive.
  • Complex or heavily-conditional charts can be hard to debug.
A slide titled "Helm: Template Engine" showing two side-by-side panels labeled "Strengths" and "Challenges." The Strengths list notes rich templating, a huge chart ecosystem, and package versioning, while the Challenges list mentions a template syntax learning curve, hard-to-read raw templates, and debugging complex charts.
Kustomize (patching) Kustomize takes a different approach: keep valid, deployable YAML in a base/ directory, and create environment-specific overlays that patch those base resources. Base files remain plain YAML (deployable directly with kubectl apply), and overlays only describe the differences. Example repo layout:
base/deployment.yaml (valid Kubernetes manifest)
overlays/prod/kustomization.yaml
overlays/prod/replicas-patch.yaml
Render the overlay with:
Kustomize strengths:
  • Base files stay as valid YAML — easy to read and debug.
  • Overlays express only the small diffs per environment.
  • Built into kubectl (no extra install required). See the Kubernetes kustomize docs for more details.
Kustomize challenges:
  • No native conditionals or loops.
  • Complex transformations can become verbose or require generators/plugins.
A slide titled "Helm vs Kustomize" that shows a side-by-side comparison table of aspects like approach, base files, conditionals/loops, package ecosystem, and best use cases. The Helm column highlights templating with Go templates and chart repos, while the Kustomize column emphasizes patching valid YAML for simple in-house overlays.
Quick comparison (at-a-glance) Which one should you use? Practical rule of thumb:
  • Use Helm for third-party projects or when you need a packaged chart with many configurable options (for example, Prometheus or cert-manager). The community often provides well-maintained charts.
  • Use Kustomize for your own services when you prefer readable base YAML and small, explicit overlays for environment differences.
Both tools are widely supported by GitOps tools such as Argo CD and Flux, so you can choose either format in your continuous delivery pipelines.
Use Helm when you need powerful templating and packaged charts. Use Kustomize when you want simple, readable base YAML and concise overlays for your own apps. Both integrate with GitOps tools like Argo CD and Flux.
To wrap up:

Watch Video