DevTools Logo

Kustomize Overlay Builder

Kustomize Overlay Builder

Compose kustomization.yaml overlays and preview the merged resources. All patching happens in your browser.

Runs in your browser

Approximate kustomize semantics — generator hashes and merge keys are simplified; nothing is uploaded.

Try an example

Overlay inputs

Overlay output

0 resources · 0 issues

No base manifests yet

Paste a base or load the example deployment.

Examples

Strategic patch

Input
spec:
  replicas: 4
Output
Deployment spec.replicas becomes 4

Unmentioned fields are preserved through a recursive merge.

Delete a container

Input
containers:
  - name: app
    $patch: delete
Output
Container removed from the list

The merge key lets directives identify list elements by name.

Append a sidecar

Input
op: add, path: /spec/template/spec/containers/-
Output
Sidecar appended

The '-' token is the standard JSON6902 append form.

About this tool

Kustomize Overlay Builder turns a pasted base manifest into a per-environment overlay. Add strategic-merge or JSON6902 patches, ConfigMap and Secret generators, image tag transformations, namespace, labels and name prefixes, then read the emitted kustomization.yaml next to the rendered resources.

The browser-side patch engine merges maps recursively, merges common list fields by their key (containers and volumes by name, Service ports by port), understands $patch: delete/replace directives and null deletions, and implements RFC 6902 operations including the '-' append token. Errors name the offending operation and path instead of silently producing a broken overlay.

The renderer follows Kustomize order: generators are materialised first, then name prefixes, namespace, labels and images are applied, and patches run last. Generator name hashes are deterministic approximations and are marked as such. Everything stays in the tab; no cluster, CLI or network is involved.

What this tool does not do

  • Merge keys are approximated for common fields; real kustomize consults schema metadata this tool does not ship.
  • Generator name suffix hashes are deterministic approximations, not kustomize's exact algorithm.
  • Generator file references are not supported; only inline literals are emitted.
  • Overlay-of-overlay chains, Helm input and full CRD-aware patching are out of scope.
  • All work is local: no build server, cluster or network call is involved.

How to use this tool

  1. Paste a base

    Add one or more manifests separated by --- on the Base tab. The resource list determines which patches can match.

  2. Add patches

    Pick a dialect, a target kind and a regex for the name, then write the patch body. The dialect is inferred as you type.

  3. Configure transforms

    Use Generators for literals and hash behaviour, Images for repository transforms, and Common for namespace, prefix and labels.

  4. Read the output

    Switch between emitted kustomization.yaml, rendered resources and the issues list. Warnings flag patches that match nothing.

  5. Copy or download

    Copy either artifact to the clipboard or download it with the expected filename.

Use cases

Environment variants

Keep one base and generate prod/staging overlays with different replicas, images and labels.

Patch syntax learning

See the rendered result of each patch flavour without installing kustomize.

Reviewing overlays

Check that target selectors match the intended resources before committing.

Generated configuration

Verify hash-suffixed ConfigMap names and reference rewriting in the rendered YAML.

Overlay sections

SectionPurpose
resourcesFile paths of the pasted base documents
patchesInline patch bodies with target kind/name selectors
configMapGenerator / secretGeneratorLiteral key/value pairs, behavior and hash options
imagesRepository transforms with newName, newTag and digest
namespace / namePrefix / labelsCommon transformers applied to every matching resource

The emitter always starts with apiVersion: kustomize.config.k8s.io/v1beta1 and kind: Kustomization.

Common mistakes

Mistake:Writing a strategic merge patch into a JSON6902 body.

Fix:The dialect toggle infers the format from the body; use -- array of op objects for JSON6902.

Mistake:Assuming images match container names.

Fix:Kustomize matches the image repository, so images[].name: nginx transforms a container named app running nginx:1.7.

Mistake:Forgetting that commonLabels also touch selectors.

Fix:The renderer injects labels into metadata, matchLabels and pod templates, matching real kustomize behavior.

Mistake:Expecting exact generator hashes.

Fix:Hashes are deterministic approximations and are marked as such; verify with a real kustomize build.

Mistake:Using a patch that matches no resource.

Fix:The Issues list warns when a selector matches zero resources instead of silently doing nothing.

Frequently asked questions

Strategic merge vs JSON6902 — which should I use?

Use a strategic-merge patch for ordinary field changes on known Kubernetes resources: deep merge, list merger keys and $patch directives make it concise. Use JSON6902 when you need positional operations such as appending a container with /containers/-, moving fields or a literal test operation. The dialect switch infers the format from your body as you type.

What are $patch directives?

They are strategic-merge instructions on a patch element. $patch: delete removes a matching list entry, $patch: replace swaps the whole list or map, and $patch: strategic is the default recursive merge. A null value deletes a single map field rather than writing an explicit null.

How do merge keys work for lists?

The renderer knows common keys: containers, initContainers, volumes and env merge by name; Service ports merge by port; container ports by containerPort. A patch element with the same key updates the existing entry instead of appending a duplicate. Fields outside that table are replaced conservatively.

Can I preview the final resources?

Yes. The Rendered resources tab shows every resource after generators, namespace, labels, images and patches have been applied, and the kustomization.yaml tab shows the file you would commit. The Issues tab lists zero-match patches and patch errors.

Does it run real kustomize?

No. It implements the common subset in the browser so you can iterate quickly. Generator hash suffixes are deterministic approximations, and exotic CRD-specific merge behavior is not modelled; verify critical overlays with kustomize build before applying them.

Is my base manifest uploaded?

Never. Parsing, patching and rendering happen in your browser tab. The tool makes no network calls and the base text is not persisted between visits.

References & standards