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