Skip to content

Patches (overlays)

Patches is a kustomize feature that can add, modify or override fields on resources. It is the new way to modify existing and declared manifests

Since kustomize 5.0.0, it makes obsolete the following features:

  • patchesJson6902
  • patchesStrategicMerge

Ways to patch

There are 2 ways to patch a resource using kustomize:

  • using JSON6902
  • using Strategic Merge

The way to declare the patch can be:

  • Using a file as reference (with the "path" key) In a strategic merge patch, the file will be a yaml file. In a json6902 will be a json file

  • With an inline patch, writing the content in the kustomization file

  • The target resource can be a single resource or multiple resources

  • Kustomize patches

https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/