← 返回命令列表

Linux command

kubectl-version 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show versions

kubectl version

Client version only

kubectl version --client

Output as JSON

kubectl version -o json

Output as YAML

kubectl version -o yaml

Short format

kubectl version --short

说明

kubectl version shows client and server versions. It displays the kubectl and Kubernetes API server versions. The command verifies version compatibility. Client and server should be within one minor version.

参数

--client
Show client version only.
-o _FORMAT_
Output format (json, yaml).
--short
Short output format.
--help
Display help information.

FAQ

What is the kubectl-version command used for?

kubectl version shows client and server versions. It displays the kubectl and Kubernetes API server versions. The command verifies version compatibility. Client and server should be within one minor version.

How do I run a basic kubectl-version example?

Run `kubectl version` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --client do in kubectl-version?

Show client version only.