access to kubernetes cluster shows time out

7/16/2019

When I try to access the Kubernetes cluster with Java app, I found the connection was timed out. When I try to connect to cluster by curl http://localhost:8080 or curl https://localhost:6443, it shows the connection is refused. I tried to solve this problem but I failed.

-- NicoleWang
java
kubernetes

1 Answer

7/16/2019

To access the cluster start the proxy with the command : kubectl proxy

[root@master pkg]# kubectl proxy Starting to serve on 127.0.0.1:8001

then from another terminal

curl https://127.0.0.1:8001

Other way to do this - Get your IP cluster with the command : kubectl cluster-info

   for example :

     kubectl cluster-info

     Kubernetes master is running at https://xxx.xxx.xxx.xxx:6443

then do : curl https://xxx.xxx.xxx.xxx:6443 --insecure

may be at this point you will find that you have to provide certificates to access the cluster.

-- EAT
Source: StackOverflow