<p>When I run Kubernetes in Docker for Mac, the Kube API only seems to be accessible from a secure endpoint of <a href="https://localhost:6443/" rel="nofollow noreferrer">https://localhost:6443/</a></p>

<p>With minikube I was able to use an insecure endpoint for Kube API like <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a></p>

<p>Is there any way to use an insecure endpoint for Kube API in Kubernetes in Docker for Mac?</p>

<p>You may be running an old version of Kubernetes with minikube.</p>

<p>The default insecure port for the kube-apiserver is 8080, but that's disabled on the latest Kubernetes versions in the kube-apiserver with the flag: <code>--insecure-port=0</code>.</p>

<p>You can always delete that line from your <code>/etc/kubernetes/manifests/kube-apiserver.yaml</code> file.</p>

<p>You also need to add this option <code>--insecure-bind-address=0.0.0.0</code> as per <a href="https://github.com/kubernetes/kubernetes/issues/49933" rel="nofollow noreferrer">this</a>.</p>

<p>Then restart the kube-apiserver.</p>

<p>Tip: Docker/Kubernetes runs on <a href="https://github.com/mist64/xhyve" rel="nofollow noreferrer">xhyve</a> VM(s) on your Mac. So to modify the Kubernetes configs you'll have to connect to your <a href="https://github.com/mist64/xhyve" rel="nofollow noreferrer">xhyve</a> VM(s). You can do it with something like this: <code>screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty</code> or <code>screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
</code></p>

<p>Adding more details: So the port 6443 is forwarded to the host using <a href="https://github.com/moby/vpnkit" rel="nofollow noreferrer">vpnkit</a>. To make port 8080 available on the host you have to also expose that port with vpnkit. If you screen into the hyperkit vm you'll see that port mappings are defined in <code>/var/vpnkit/port</code>. There's a <code>README</code> file on that directory that you can follow to expose port 8080.</p>
