首页 文章

如何通过kubernetes cluster ip访问服务?

提问于
浏览
1

我通过kubeadm构建了一个kubernetes集群并创建了几个服务 . 这些服务可以通过节点ip:port从外部访问,但是当我尝试通过集群ip访问服务时,它会失败,它会显示错误消息curl:(7)连接到10.99.237.89:2379失败;连接超时,这个如何解决问题?

与集群相关的信息

enter image description here

enter 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@********** ~]#

1 回答

  • 2

    群集IP无法从群集外部访问,它们仅在内部 .

    有关详细信息,请参阅here

相关问题