不启动 Kubernetes 的 Kubectl 文档
Kubectl documentation without starting Kubernetes
我已经使用 Kubeadm 和 VirtualBox 在笔记本电脑上安装了 K8S 集群。集群必须启动似乎有点奇怪 运行 请参阅如下所示的文档。
praveensripati@praveen-ubuntu:~$ kubectl explain pods
Unable to connect to the server: dial tcp 192.168.0.31:6443: connect: no route to host
有什么解决方法吗?
参见“kubectl explain — #HeptioProTip”
Behind the scenes, kubectl
just made an API request to my Kubernetes cluster, grabbed the current Swagger documentation of the API version running in the cluster, and output the documentation and object types.
尝试 kubectl help
作为离线替代方案,但这不会那么完整(仅限于 kubectl 本身)。
'explain' 文档存在于 kube-apiserver
and its resource definitions. Hence the need to connect to it through kubectl explain
to get any docs. This is different from the standard very basic cli help from kubectl
where it's in the kubectl
Golang 代码中。
所以除了设置虚拟 Kubernetes 集群并让 kubectl 指向它之外,没有其他解决方法。请注意,CRDs 帮助可能不可用,因为它们存在于已部署的 CRD 中。
所以一个相当发人深省的消息是 AFAIK 并没有开箱即用的方法,尽管你完全可以写一个 kubectl
插件(现在在 1.12 中它变得相当微不足道)。但就目前而言,我能提供的最好的是:
# figure out which endpoint kubectl uses to retrieve docs:
$ kubectl -v9 explain pods
# from above I learn that in my case it's apparently
# https://192.168.64.11:8443/openapi/v2 so let's curl that:
$ curl -k https://192.168.64.11:8443/openapi/v2 > resources-docs.json
例如,您可以从这里use jq查询描述。它不如适当的解释好,但在有人编写文档离线查询 kubectl 插件之前,这是一个足够好的解决方法。
我已经使用 Kubeadm 和 VirtualBox 在笔记本电脑上安装了 K8S 集群。集群必须启动似乎有点奇怪 运行 请参阅如下所示的文档。
praveensripati@praveen-ubuntu:~$ kubectl explain pods
Unable to connect to the server: dial tcp 192.168.0.31:6443: connect: no route to host
有什么解决方法吗?
参见“kubectl explain — #HeptioProTip”
Behind the scenes,
kubectl
just made an API request to my Kubernetes cluster, grabbed the current Swagger documentation of the API version running in the cluster, and output the documentation and object types.
尝试 kubectl help
作为离线替代方案,但这不会那么完整(仅限于 kubectl 本身)。
'explain' 文档存在于 kube-apiserver
and its resource definitions. Hence the need to connect to it through kubectl explain
to get any docs. This is different from the standard very basic cli help from kubectl
where it's in the kubectl
Golang 代码中。
所以除了设置虚拟 Kubernetes 集群并让 kubectl 指向它之外,没有其他解决方法。请注意,CRDs 帮助可能不可用,因为它们存在于已部署的 CRD 中。
所以一个相当发人深省的消息是 AFAIK 并没有开箱即用的方法,尽管你完全可以写一个 kubectl
插件(现在在 1.12 中它变得相当微不足道)。但就目前而言,我能提供的最好的是:
# figure out which endpoint kubectl uses to retrieve docs:
$ kubectl -v9 explain pods
# from above I learn that in my case it's apparently
# https://192.168.64.11:8443/openapi/v2 so let's curl that:
$ curl -k https://192.168.64.11:8443/openapi/v2 > resources-docs.json
例如,您可以从这里use jq查询描述。它不如适当的解释好,但在有人编写文档离线查询 kubectl 插件之前,这是一个足够好的解决方法。