smr*_*t28 5 manpage doc kubernetes
我可以在哪里获取和安装 kubectl 手册页的任何建议?一直问谷歌越来越烦人。
我希望能够从命令行查看手册页,例如:
$ man kubectl pods
Run Code Online (Sandbox Code Playgroud)
我显然知道互联网上的在线文档。
谢谢
小智 3
CLIkubectl是用Golang编写的,并使用Cobra功能根据子命令、标志等自动生成文档。
因此,您可以使用kubectl --help查看所有可用选项。此外,您可以深入研究特定的子命令选项(例如,kubectl describe --help等kubectl get --help)。
不仅如此,您还可以使用kubectl explain来描述与每个受支持的 API 资源关联的字段,这在编写模板时非常有用。例子:
# Get the documentation of the resource and its fields
kubectl explain pods
# Get the documentation of a specific field of a resource
kubectl explain pods.spec.containers
Run Code Online (Sandbox Code Playgroud)