Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access services through kubernetes cluster ip?

Tags:

kubernetes

I built a kubernetes cluster through kubeadm and created several services. These services can be accessed externally through the node ip: port, but when I try to access the service through cluster ip, it fails, it displays the error message curl: (7) Failed connect to 10.99.237.89:2379; Connection timed out, this How to solve the problem?

Cluster-related information

enter image description hereenter image description here

[root@********** ~]# kubectl describe svc etcd-torus-internal --namespace=default
Name:                   etcd-torus-internal
Namespace:              default
Labels:                 name=etcd-torus-internal
Selector:               name=etcd-torus
Type:                   ClusterIP
IP:                     10.99.237.89
Port:                   etcd-client     2379/TCP
Endpoints:              10.244.1.10:2379
Session Affinity:       None
No events.
[root@********** ~]# curl 10.99.237.89:2379
curl: (7) Failed connect to 10.99.237.89:2379; Connection timed out
[root@********** ~]#
like image 729
shuwenouwan Avatar asked Oct 30 '22 13:10

shuwenouwan


1 Answers

Cluster IPs are not accessible from outside the cluster, they are internal only.

See here for more details

like image 196
jaxxstorm Avatar answered Nov 15 '22 10:11

jaxxstorm