← 返回命令列表

Linux command

kubectl-explain 命令

文本

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

常用示例

Explain resource

kubectl explain [pod]

Explain field

kubectl explain [pod.spec]

Explain nested field

kubectl explain [pod.spec.containers]

Show recursive structure

kubectl explain [pod] --recursive

Explain specific API version

kubectl explain [deployment] --api-version=[apps/v1]

说明

kubectl explain shows resource and field documentation. It displays the schema for Kubernetes objects. The command helps write manifests correctly. It shows field types, defaults, and descriptions.

参数

--recursive
Show all fields recursively.
--api-version _VERSION_
Explain specific API version.
--help
Display help information.

FAQ

What is the kubectl-explain command used for?

kubectl explain shows resource and field documentation. It displays the schema for Kubernetes objects. The command helps write manifests correctly. It shows field types, defaults, and descriptions.

How do I run a basic kubectl-explain example?

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

What does --recursive do in kubectl-explain?

Show all fields recursively.