Kustomize and Helm with ArgoCD

Managing Dev, Staging, and Production (Without Copy-Paste Hell)

I had three environments: dev, staging, production.

My first approach? Copy the manifests:

manifests/
β”œβ”€β”€ dev/
β”‚   β”œβ”€β”€ deployment.yaml     # 3 replicas, dev image
β”‚   β”œβ”€β”€ service.yaml
β”‚   └── configmap.yaml
β”œβ”€β”€ staging/
β”‚   β”œβ”€β”€ deployment.yaml     # 5 replicas, staging image
β”‚   β”œβ”€β”€ service.yaml
β”‚   └── configmap.yaml
└── production/
    β”œβ”€β”€ deployment.yaml     # 10 replicas, prod image
    β”œβ”€β”€ service.yaml
    └── configmap.yaml

The pain:

  • Changed service.yaml? Copy to all 3 environments

  • Fixed a bug in deployment.yaml? Update in 3 places

  • Added new resource? Copy to 3 directories

  • Drift between environments constantly

Then I discovered Kustomize and Helm with ArgoCD. Game changer.

The Problem: Environment-Specific Configuration

Same application, different configurations per environment:

Configuration
Dev
Staging
Production

Replicas

1

3

10

Resources

Low

Medium

High

Image tag

latest

v1.2.3

v1.2.3

Domain

dev.example.com

staging.example.com

example.com

Database

dev-db

staging-db

prod-db

Secrets

dev-secrets

staging-secrets

prod-secrets

How to manage this without duplication?

Answer: Kustomize or Helm.

Approach 1: Kustomize with ArgoCD

Kustomize is a Kubernetes-native configuration management tool. It uses bases and overlays.

Kustomize Concepts

Base = Common resources Overlay = Environment-specific changes

Setting Up Kustomize Structure

Create Base Manifests

base/deployment.yaml:

base/service.yaml:

base/kustomization.yaml:

Create Dev Overlay

overlays/dev/kustomization.yaml:

Create Staging Overlay

overlays/staging/kustomization.yaml:

Create Production Overlay

overlays/production/kustomization.yaml:

Test Locally

Commit to Git

Creating ArgoCD Applications for Each Environment

Dev Application

Staging Application

Production Application

Deploy All Environments

Verify Different Configurations

Making Changes Across Environments

Scenario: Update service port from 80 to 8080.

Result: One change, three environments updated. No copy-paste.

Approach 2: Helm with ArgoCD

Helm is a package manager for Kubernetes. Uses templates with values.

Helm Concepts

Template = Manifest with placeholders Values = Data to fill placeholders

Create Helm Chart

Create Deployment Template

templates/deployment.yaml:

Create Service Template

templates/service.yaml:

Default Values

values.yaml:

Environment-Specific Values

values/dev.yaml:

values/staging.yaml:

values/production.yaml:

Test Locally

Commit to Git

Creating ArgoCD Applications for Helm

Dev Application

Staging Application

Production Application with Value Overrides

Deploy

Kustomize vs Helm: Which to Choose?

Feature
Kustomize
Helm

Learning Curve

Low (just patches)

Medium (templating)

Native to K8s

Yes (built into kubectl)

No (separate tool)

Templating

Limited (patches only)

Full (Go templates)

Package Management

No

Yes (charts, repos)

Community Charts

No

Yes (huge ecosystem)

Complexity

Simple

Can get complex

ArgoCD Support

Excellent

Excellent

My recommendation:

  • Simple apps, single team: Kustomize

  • Complex apps, many teams: Helm

  • Using 3rd-party apps: Helm (charts available)

  • Full control, simplicity: Kustomize

Advanced: Combining Kustomize + Helm

You can use Helm charts with Kustomize post-processing!

ArgoCD Application:

Promoting Changes Across Environments

Workflow:

Better: Use PRs for production

Key Takeaways

  1. Kustomize: Overlays pattern

    • Base + environment-specific patches

    • DRY, no duplication

    • Native to Kubernetes

  2. Helm: Values pattern

    • Templates + environment-specific values

    • Powerful templating

    • Package management

  3. ArgoCD supports both

    • Kustomize: source.path points to overlay

    • Helm: source.helm.valueFiles specifies values

  4. One repo, multiple environments

    • Shared base/templates

    • Environment-specific overlays/values

    • Single source of truth

  5. Git-driven promotion

    • Commit to dev β†’ test β†’ promote to staging β†’ promote to prod

    • PR workflow for production changes

    • Full audit trail

In the next article, we'll explore advanced ArgoCD features: sync waves, resource hooks, ApplicationSets, multi-cluster deployments, and more.


Previous: Your First ArgoCD Application Next: Advanced ArgoCD Features

Last updated