Consider if we build two VMs in a bare-metal server through a network, one is master and another is worker. I ssh
to the master and construct a cluster using kubeadm
which has three pods and a service with type: ClusterIP
. So when I want access to the cluster I do kubectl proxy
in the master. Now we can explore the API with curl
and wget
in the VM which we ssh
to it, like this :
$ curl http://localhost:8080/api/
So far, so good! but I want access to the services by my laptop? The localhost which comes above is refer to the bare-metal server! How can access to the services through proxy by my laptop when cluster is placed in another machine?
When I do $ curl http://localhost:8080/api/
in my laptop it says :
127.0.0.1 refused to connect
which make sense! But what is the solution to this?