Kustomize
Medium
Commands
How can you see what kubectl apply -k would change in the cluster before applying it?
Select your answer:
Show answer and explanation
Answer: Run kubectl diff -k <dir>
Explanation
'kubectl diff -k' builds the kustomization and compares it with the live objects using a server-side dry run. It exits with 1 when it finds differences, which CI jobs can check.
More medium Kustomize questions
- Can a kustomization include a Helm chart?
- What does kustomize edit fix do?
- An overlay's strategic merge patch fails with "failed to find unique target for patch". What is the usual cause?
- A base and an overlay both have an images entry for nginx with different tags. Which tag ends up in the output?
- Which file names does Kustomize accept for the kustomization file in a directory?
- Why can adding a label through commonLabels make kubectl apply fail for an existing Deployment?