<p>I installed <code>kubernetes</code> use <code>kubeadm</code> and the <code>kube-apiserver</code> started successfully. My computer's operating system is Centos 7. Command like these:</p>
<pre><code>kube-apiserver
      --advertise-address=10.211.55.9
      --allow-privileged=true
      --authorization-mode=Node,RBAC
      --client-ca-file=/etc/kubernetes/pki/ca.crt
      --enable-admission-plugins=NodeRestriction
      --enable-bootstrap-token-auth=true
      --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt
      --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt
      --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key
      --etcd-servers=https://127.0.0.1:2379
      --insecure-port=0
      --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt
      --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key
      --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
      --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt
      --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key
      --requestheader-allowed-names=front-proxy-client
      --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
      --requestheader-extra-headers-prefix=X-Remote-Extra-
      --requestheader-group-headers=X-Remote-Group
      --requestheader-username-headers=X-Remote-User
      --secure-port=6443
      --service-account-key-file=/etc/kubernetes/pki/sa.pub
      --service-cluster-ip-range=10.96.0.0/12
      --tls-cert-file=/etc/kubernetes/pki/apiserver.crt
      --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
      --enable-swagger-ui=true
      --insecure-bind-address=0.0.0.0
      --insecure-port=8080
</code></pre>
<p>open web browser and search <code>http://localhost:8080/swagger-ui/</code>, I got the uri list without swagger ui. How to show swagger ui?</p>
<pre><code>http://localhost:8080/swagger-ui/
{
  &quot;paths&quot;: [
    &quot;/apis&quot;,
    &quot;/apis/&quot;,
    &quot;/apis/apiextensions.k8s.io&quot;,
    &quot;/apis/apiextensions.k8s.io/v1&quot;,
    &quot;/apis/apiextensions.k8s.io/v1beta1&quot;,
    &quot;/healthz&quot;,
    &quot;/healthz/etcd&quot;,
    &quot;/healthz/log&quot;,
    &quot;/healthz/ping&quot;,
    &quot;/healthz/poststarthook/crd-informer-synced&quot;,
    &quot;/healthz/poststarthook/generic-apiserver-start-informers&quot;,
    &quot;/healthz/poststarthook/start-apiextensions-controllers&quot;,
    &quot;/healthz/poststarthook/start-apiextensions-informers&quot;,
    &quot;/livez&quot;,
    &quot;/livez/etcd&quot;,
    &quot;/livez/log&quot;,
    &quot;/livez/ping&quot;,
    &quot;/livez/poststarthook/crd-informer-synced&quot;,
    &quot;/livez/poststarthook/generic-apiserver-start-informers&quot;,
    &quot;/livez/poststarthook/start-apiextensions-controllers&quot;,
    &quot;/livez/poststarthook/start-apiextensions-informers&quot;,
    &quot;/metrics&quot;,
    &quot;/openapi/v2&quot;,
    &quot;/readyz&quot;,
    &quot;/readyz/etcd&quot;,
    &quot;/readyz/log&quot;,
    &quot;/readyz/ping&quot;,
    &quot;/readyz/poststarthook/crd-informer-synced&quot;,
    &quot;/readyz/poststarthook/generic-apiserver-start-informers&quot;,
    &quot;/readyz/poststarthook/start-apiextensions-controllers&quot;,
    &quot;/readyz/poststarthook/start-apiextensions-informers&quot;,
    &quot;/readyz/shutdown&quot;,
    &quot;/version&quot;
  ]
}
</code></pre>

double sun
<p>The easiest way to get the openapi json is:</p>
<pre><code>kubectl get --raw /openapi/v2  &gt; k8s-openapi-v2.json
</code></pre>
<p>Now you can start a swagger-ui instance for that json like so:</p>
<pre><code>docker run \
  -v $PWD/k8s-openapi-v2.json:/app/swagger.json \
  -p 8081:8080 \
  swaggerapi/swagger-ui
</code></pre>
<p>Navigate to https://localhost:8081<br />
You'll see the swagger UI.
It's pretty laggy though, because of the many APIs a Kubernetes cluster exposes.</p>
