Kustomize
Medium
Mutation
How do you remove a container from a base Deployment with a strategic merge patch?
Select your answer:
Show answer and explanation
Answer: Add $patch: delete to that container's entry in the patch
Explanation
The $patch directive changes how a strategic merge patch treats an element: delete removes the matching entry and replace swaps it out entirely. Both work in patch files and in inline patches.
More medium Kustomize questions
- When is a JSON 6902 patch a better choice than a strategic merge patch?
- A patch target sets kind: Deployment and labelSelector: tier=backend. Which resources does the patch change?
- What are Kustomize components for?
- Which field replaces the deprecated vars for copying a value from one resource into another?
- How do you reference a base from a Git repository under resources?
- kustomize build fails because a patch file sits outside the kustomization's directory. What does the default load restrictor require?