DevTools Logo

Helm Values Diff & Merge

Helm Values Diff & Merge

Merge a values override into base values with Helm semantics and see what changed.

Runs in your browser
Maps merge, lists replace, null deletes a key.
Try an example

Base values

10 lines · 129 chars

Override values

8 lines · 97 chars

Merged values

11 lines · 137 chars
Comments are not kept and the output is regenerated, with keys sorted alphabetically.
image:
  repository: nginx
  tag: canary
replicaCount: 3
resources:
  limits:
    cpu: 500m
    memory: 256Mi
service:
  type: ClusterIP

Examples

Null deletes and list replacement

Input
mergeHelmValues("replicas: 2\nports:\n  - 80\n  - 443", "replicas: null\nports:\n  - 8080")
Output
merged without replicas:, ports: [8080], diff: changed:ports + deleted:replicas

Null removes the replicas key while the ports list is replaced rather than concatenated.

Nested map merge

Input
mergeHelmValues("image:\n  repository: app\n  tag: stable", "image:\n  tag: canary")
Output
repository: app preserved, tag: canary, diff: changed:image.tag

The override changes only the nested tag key; untouched sibling keys survive the merge.

About this tool

Helm Values Diff & Merge compares and merges two values documents with mergeHelmValues(baseSource, overrideSource): both sources parse via js-yaml (blank input becomes {}), deepMerge combines maps recursively, the merged document dumps with sortKeys for byte-deterministic output, and diffValues flattens both trees into sorted dotted paths tagged added, changed, or deleted.

Null is the delete signal at any map level: an override value of null removes that key from the merged result and surfaces as a deleted diff entry, while lists are always replaced wholesale (ports [80, 443] overridden by [8080] yields exactly [8080] with a changed entry). Nested maps merge key-by-key, so overriding image.tag preserves sibling image.repository untouched.

Failures are explicit: unparseable YAML returns ok: false with the parser message, a 1-based line from the YAML mark when available, and an empty diff array. Everything runs client-side, so chart values and secrets never leave the browser.

How to use this tool

  1. Paste base and override values

    Put the chart defaults in the base pane and the environment overrides in the override pane — empty input is treated as an empty map.

  2. Null out keys to delete them

    Set any override key to null (e.g. replicas: null) to drop it from the merged output instead of rendering an explicit null.

  3. Review the sorted diff list

    Read the added/changed/deleted path list to confirm each intended change, then check the merged YAML preview for the final document.

  4. Copy the merged output

    Paste the deterministic merged YAML into a values file or a helm install -f override, knowing identical inputs always produce identical output.

Use cases

Previewing environment overrides

Diff staging or production values against chart defaults before running helm upgrade.

Pruning inherited keys

Null out default keys (replicas, persistence flags) that an environment must not set.

Auditing values drift

Flatten two values files into a sorted added/changed/deleted path list for review.

Common mistakes

Mistake:Expecting lists to concatenate across files.

Fix:Lists replace wholesale — mergeHelmValues never appends items, so restate the full desired list in the override.

Mistake:Writing an explicit null and expecting it in the output.

Fix:Null means delete: the key disappears from merged YAML and appears as a deleted diff entry, not as key: null.

Mistake:Treating a parse failure as an empty diff.

Fix:Invalid YAML returns ok: false with error and line plus an empty diff — check ok and error before trusting the merged document.

Frequently asked questions

What does this tool do?

It merges two Helm values documents with mergeHelmValues: blank input counts as {}, maps merge recursively, the merged YAML dumps with sorted keys, and diffValues reports sorted dotted paths as added, changed, or deleted.

How do null values and lists behave?

An override null deletes that key (a deleted diff entry) at any map level, and lists replace wholesale — overriding [80, 443] with [8080] yields exactly [8080] with a changed entry, never a concatenation.

Is my values data uploaded or stored?

No. Parsing, merging, and diffing run entirely in your browser via js-yaml — chart values and secrets never leave your device.

What happens on invalid YAML?

The result returns ok: false with the parser message, a 1-based line when the YAML mark provides one, and an empty diff array. Check ok and error before using the merged output.

References & standards