Strategic merge patch is a Kubernetes patching mechanism created to handle merging of desired configuration state with live API state, particularly for arrays. Standard JSON Merge Patch cannot patch array elements individually, which is a problem since Kubernetes APIs heavily use arrays (containers, ports, env vars). The solution introduces patchStrategy and patchMergeKey annotations on array fields, allowing elements to be matched by a designated key field rather than positional index. This originated from design decisions to use named fields instead of map keys, support asynchronous controllers like the horizontal pod autoscaler, and tolerate dynamically set fields. The mechanism was later reused in Kustomize for overlay patching and is now being extended in ConfigHub for general-purpose configuration merging beyond Kubernetes.
Sort: