Linux command
kubectl-diff 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show diff against live configuration
kubectl diff -f [manifest.yaml]
Diff entire directory
kubectl diff -f [manifests/]
Diff from stdin
cat [manifest.yaml] | kubectl diff -f -
说明
kubectl diff shows differences between the current live configuration and the proposed configuration in a file. Useful for previewing changes before applying them. Uses server-side dry run to compute the diff.
参数
- -f, --filename _file_
- File containing configuration to diff.
- -R, --recursive
- Process directory recursively.
- -l, --selector _selector_
- Label selector for filtering.
FAQ
What is the kubectl-diff command used for?
kubectl diff shows differences between the current live configuration and the proposed configuration in a file. Useful for previewing changes before applying them. Uses server-side dry run to compute the diff.
How do I run a basic kubectl-diff example?
Run `kubectl diff -f [manifest.yaml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f, --filename _file_ do in kubectl-diff?
File containing configuration to diff.