How to connect to k8s cluster of docker desktop on another machine? How to connect to k8s cluster of docker desktop on another machine? kubernetes kubernetes

How to connect to k8s cluster of docker desktop on another machine?


You can just copy your .kube/config file from the mac-mini desktop to macbook, you dont have to write the config file again if you want to use the same context.


In the macbook, the port number has to be specified as below. That's the port number of the K8S APIServer. (1)

server: http://192.168.1.104:6443


It seems your kubernetes api server did not boud to local accesible ipv4, but it is bound to host's 127.0.0.1

$ netstat -na|grep 6443tcp4 0 0 127.0.0.1.6443 . LISTEN

Which means it can not be accessed event within same network.

you need to proxy this port to local ipv4 network ip. you can do this as below with command prompt running in kubernetes host computer as administrator:

etsh interface portproxy add v4tov4 listenaddress=192.168.1.104 listenport=6443 connectaddress=127.0.0.1 connectport=6443