Debug Kustomize: troubleshooting commands
10 commands in 2 groups: Debug Build, Inspect & Diff. Click or tap any command to copy it. Official documentation: kubectl.docs.kubernetes.io.
Open in the interactive cheat sheet search, stars and every other section
Debug Build
Diagnose render failures and validate the output of an overlay before applying it to the cluster.
kubectl apply -k <dir> --dry-run=client
Preview the apply without persisting anything (client-side, still needs cluster access)
kubectl apply -k <dir> --dry-run=server
Server-side dry-run for admission webhook checks
kustomize build <dir>
Render overlay to see full output or error message
kustomize build --load-restrictor=LoadRestrictionsNone <dir>
Allow files outside the kustomization root (common path error)
kustomize build --enable-alpha-plugins --enable-exec <dir>
Enable plugins and KRM functions, including exec functions (trusted configs only)
Inspect & Diff
Compare rendered output against the live cluster state and verify specific fields like images and namespaces.
kustomize build <dir> | grep 'image:'
Verify image substitutions in rendered output
kustomize build <dir> | grep 'namespace:'
Check namespace assignments in rendered output
kustomize build <dir> | grep -A5 'kind: <Kind>'
Find a specific resource kind in rendered output
kubectl diff -k <dir>
Diff overlay against live cluster state
kubectl get -k <dir>
List all resources the overlay manages