<p>I have installed a K8S cluster on laptop using Kubeadm and VirtualBox. It seems a bit odd that the cluster has to be up and running to see the documentation as shown below.</p>

<pre><code>praveensripati@praveen-ubuntu:~$ kubectl explain pods
Unable to connect to the server: dial tcp 192.168.0.31:6443: connect: no route to host
</code></pre>

<p>Any workaround for this?</p>

Praveen Sripati
<p>So the rather sobering news is that AFAIK there's not out-of-the box way how to do it, though you could totally write a <code>kubectl</code> plugin (it has become rather trivial now in 1.12). But for now, the best I can offer is the following:</p>

<pre><code># 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 &gt; resources-docs.json
</code></pre>

<p>From here you can, for example, <a href="http://andrew.gibiansky.com/blog/command-line/jq-primer/" rel="nofollow noreferrer">use jq</a> to query for the descriptions. It's not as nice as a proper explain, but kinda is a good enough workaround until someone writes an docs offline query kubectl plugin.</p>
