About the Kustomize cheat sheet
Kustomize's central idea is that every input stays valid YAML. There is no templating language — you write real manifests in a base, and overlays patch them for each environment. That is the trade: nothing to learn beyond patches, and more verbosity when variation is genuinely complex.
The structure that works is a base holding what is common and one overlay per environment holding only differences. Overlays that restate whole manifests defeat the point, because a change to the common part then needs making in several places — which is the problem the base exists to prevent.
Generators are the feature most worth using. ConfigMap and Secret generators append a content hash to the resource name and rewrite every reference, so changing configuration changes the pod template and triggers a rollout. That solves the classic problem where editing a ConfigMap changes nothing until something restarts.
Frequently asked questions
How do I preview what will be applied?
Build the overlay and read the rendered output rather than applying directly. Everything Kustomize does is visible in that output, which is the main ergonomic advantage over templating — what you review is exactly what will be sent to the cluster, with no rendering step you cannot inspect.
When should I use a strategic merge patch versus a JSON patch?
Strategic merge for most changes — it reads like the manifest and merges maps sensibly. JSON patch when you need precise list operations, such as removing an element or inserting at a position, which strategic merge handles awkwardly. Reach for JSON patch as the exception rather than the default.
Why did my ConfigMap change not restart the pods?
If you wrote the ConfigMap as a plain resource, its name did not change, so the pod template did not change and nothing restarted. Use a ConfigMap generator instead: the appended hash changes the name and every reference to it, which changes the template and triggers a rollout automatically.
Can I use Kustomize with Helm charts?
Yes, and it is a common combination. Render the chart, then treat the output as a base and patch it in an overlay — useful when a chart does not expose a value you need. Kustomize can also inflate a chart directly, though rendering separately keeps the inputs easier to inspect and diff.
Do I need to install Kustomize separately?
Not for basic use — kubectl has it built in via apply and the kustomize subcommand. The bundled version lags the standalone release, so newer features may be missing. If you depend on something recent, install the standalone binary and pin its version in CI so local and pipeline behaviour match.