1

Kustomize supports two ways to modify live kubernetes manifests:

Patches (also called overlays) add or override fields on resources. They are provided using the patches Kustomization field.

Replacements are used to copy fields from one source into any number of specified targets.

They seemingly serve the same purpose.

What are the differences between them? In which situations one is recommended over the other?

1 Answer 1

3

They do two completely different and distinct things.

"Replacements" are used to "copy fields from one source into any number of specified targets". You can't do that with a patch (a patch cannot copy data from an existing resource).

A patch is used to apply arbitrary transformations to a YAML document. You can use patches to do things like add, replace, or delete attributes in your resources. You can merge new entries into a list. You can't do that with replacements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.