-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Enhancement Description
- One-line enhancement description (can be used as a release note):
Extend Kustomize Patches to Multiple Targets
- Kubernetes Enhancement Proposal:
Currently, there are different types of patches supported in Kustomize:
strategic merge patch and JSON patch.
patchesStrategicMerge:
- service_port_8888.yaml
- deployment_increase_replicas.yaml
- deployment_increase_memory.yaml
patchesJson6902:
- target:
version: v1
kind: Deployment
name: my-deployment
path: add_init_container.yaml
- target:
version: v1
kind: Service
name: my-service
path: add_service_annotation.yaml
Both types need group, version, kind and name(GVKN) of a Kubernetes resource to find
the unique target to perform the patching. In strategic merge patch, GVKN is included
in the patch itself. In JSON patch, the GVKN is specified in kustomization.yaml.
There have been requests for patching multiple targets by one patch for different purposes:
- override one field for all objects of one type
- add or remove common command arguments for all containers
- inject a [sidecar proxy](https://istio.io/docs/setup/kubernetes/sidecar-injection/) as in istio to all containers
-
Discussion Link:
-
Primary contact (assignee): @Liujingfang1 @pwittrock @mengqiy
-
Responsible SIGs: sig-cli
-
Enhancement target (which target equals to which milestone):
- Alpha release target (x.y):
- Beta release target (x.y):
- Stable release target (x.y):
-
Alpha
- KEP (
k/enhancements) update PR(s): - Code (
k/k) update PR(s): - Docs (
k/website) update PR(s):
- KEP (
-
Add
Patchstruct inKustomizationtype. -
Update the patching transformer to recognize
Patchand match
multiple resources -
Add unit test and integration test
Please keep this description up to date. This will help the Enhancement Team to track the evolution of the enhancement efficiently.