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.
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
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.