concept

Patch and replace semantics

Patch formats have different semantics. JSON merge replaces arrays; strategic merge can match supported built-in list entries by schema-defined keys; JSON Patch performs ordered operations on exact paths. Normal replace sends a complete object representation and should protect concurrent updates with resourceVersion.

Formal Syntax & Structure

kubernetes syntaxkubernetes
kubectl patch RESOURCE NAME --type=json|merge|strategic --patch-file FILE

Working Example

Example Snippetkubernetes
spec:  template:    spec:      containers:        - name: catalog          image: registry.example.invalid/catalog:v2
Kubernetes Reference