k8wiz
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.