<p>According to <a href="https://kubernetes.io/docs/concepts/overview/kubernetes-api/" rel="nofollow noreferrer">Kubernetes documentation</a>, you can ping an http endpoint for a K8s cluster to operate it instead of using e.g. <code>kubectl</code>. It also says that there is an openApi interface available at <code>/openapi/v2</code>. I'm running minikube on MacOS and would like to check it out. Does anyone know if that is possible?</p>
<p>I tried:</p>
<pre><code>minikube list service # Shows 'kubernetes' as a name
minikube list kubernetes
</code></pre>
<p>... which opens the browser to <code>127.0.0.1:51377</code>. However, when I try going to <code>https://127.0.0.1:51377/openapi/v2</code> I get the message:</p>
<pre><code>{
&quot;kind&quot;: &quot;Status&quot;,
&quot;apiVersion&quot;: &quot;v1&quot;,
&quot;metadata&quot;: {},
&quot;status&quot;: &quot;Failure&quot;,
&quot;message&quot;: &quot;forbidden: User \&quot;system:anonymous\&quot; cannot get path \&quot;/openapi/v2\&quot;&quot;,
&quot;reason&quot;: &quot;Forbidden&quot;,
&quot;details&quot;: {},
&quot;code&quot;: 403
}
</code></pre>
<p>... suggesting that I need some sort of authorization solution. Suggestions?</p>

Magnus
<p>This worked for me:</p>
<pre><code># Proxy minikube to localhost on arbitrary port:
kubectl proxy --port=12345

# Now swagger.json is available at localhost:12345/openapi/v2
# Save to /tmp/temp/json and serve with e.g. docker swagger-ui container
curl localhost:12345/openapi/v2 &gt; /tmp/temp.json
docker run -it -p 9999:8080 -e SWAGGER_JSON=/var/specs/temp.json -v /tmp/temp.json:/var/specs/temp.json swaggerapi/swagger-ui

# Open browser to localhost:9999
</code></pre>
