Look, Kustomize came about because someone at Google got tired of maintaining 47 slightly different versions of the same deployment YAML. Instead of doing the sensible thing and just using environment variables, they built a patch-based system that's simultaneously brilliant and infuriating.
The core idea is deceptively simple: keep your base YAML files pristine and patch them for different environments. No more copying deployment-dev.yaml
, deployment-staging.yaml
, and deployment-prod.yaml
that are 95% identical except for replica counts and image tags. Instead, you maintain one canonical base deployment and patch it with overlay configurations. The Kubernetes blog post introducing Kustomize explains the original motivation behind this approach.
How It Actually Works in Practice
Here's what happens when you run kubectl apply -k
:
- Kustomize reads your
kustomization.yaml
file (if it can find it) - It loads all your base resources and applies patches in a specific order
- It spits out final YAML that kubectl can understand
- kubectl applies it to your cluster, usually breaking something you didn't expect
The official docs make this sound elegant. In reality, you'll spend quality time figuring out why your patch didn't apply. Spoiler: it's probably because you misspelled a field name or screwed up the indentation.
The Good, The Bad, and The Ugly
The Good: No more template syntax hell. Your YAML files are actual Kubernetes YAML that you can kubectl apply
directly. The kubectl integration means you don't need another tool installed (well, you do need the standalone version for the latest features, but whatever). The declarative approach aligns with Kubernetes philosophy, and GitOps tools like ArgoCD support it natively.
The Bad: Strategic merge patches sound smart but work in mysterious ways. JSON patches are precise but debugging them requires the patience of a saint. The error messages are about as helpful as a chocolate teapot. The community forums are full of people asking "why isn't my patch applying?" Check the troubleshooting guide for common gotchas.
The Ugly: Version mismatches between standalone Kustomize and kubectl's built-in version will ruin your day. As of August 2025, standalone is at v5.7.1 (released July 23rd, 2025) while kubectl is stuck at v5.4.2. The latest release introduces code to replace the shlex library and drops some dependencies. Good luck figuring out which features work where. The installation guide covers different installation methods, but you'll still need to manage multiple versions.
Real Talk from Production
I've seen teams successfully use Kustomize to manage hundreds of microservices. I've also seen developers spend entire afternoons debugging why their replica count patch wasn't applying (it was a YAML indentation issue, obviously).
Companies like Shopify swear by it for managing their massive Kubernetes deployments. But they also have dedicated platform teams who understand the nuances. If you're a startup with 3 engineers, you might want to start with something simpler.
The Directory Structure That Everyone Uses
your-app/
├── base/
│ ├── kustomization.yaml # References your common resources
│ ├── deployment.yaml # Your actual deployment
│ └── service.yaml # Your service definition
└── overlays/
├── dev/
│ ├── kustomization.yaml # References base + dev patches
│ └── patches/
├── staging/
│ ├── kustomization.yaml # References base + staging patches
│ └── patches/
└── prod/
├── kustomization.yaml # References base + prod patches
└── patches/
This structure works until you have 50+ services and realize you need a better way to organize things. Then you start reading about components and wish you'd just used Helm. The directory management guide has practical tips for large-scale setups. For complex scenarios, check out GitOps repo structures and multi-environment workflows that scale beyond the basic pattern.
Integration Reality Check
ArgoCD: Native support that works well, when ArgoCD's sync process doesn't get confused by your patch ordering. The Argo Rollouts integration adds progressive delivery features.
Flux: The Kustomize controller is solid, but you'll spend time learning Flux's way of doing things. Check out the Flux v2 kustomization reference for advanced options.
CI/CD Pipelines: Works great with GitHub Actions and Jenkins, assuming your build agents have the right kubectl version. The Google Cloud Build integration supports Config Sync workflows, and Tekton Pipelines can run kustomize builds natively.
The truth is, Kustomize is a powerful tool that fills a real need. It's also a tool that will teach you more about YAML formatting than you ever wanted to know. Whether that's worth it depends on how much you hate Helm templating.