【问题标题】:unable to access Azure kubernetes load balancer external ip from internet无法从 Internet 访问 Azure kubernetes 负载均衡器外部 ip
【发布时间】:2019-10-27 23:41:49
【问题描述】:

我创建了一个带有多节点池的 K8s 集群,因为我需要使用 Windows 容器。 windows节点池有1个节点。我已经创建了负载均衡器类型的部署和服务,该负载均衡器在部署时获得了外部 IP。但是当我从笔记本电脑 ping 外部 IP 时,我收到一个请求超时。我有某些 WCF 微服务需要访问部署在 Windows 容器中的服务,反之亦然。因为我无法从我的机器上 ping 负载均衡器 IP,我怀疑 WCF 微服务也可以。我无法从运行这些外部微服务的 Azure VM ping 此外部 IP。 我们可以从 Internet ping 分配给 K8s 负载均衡器的外部 IP。如果是这样,我是否需要对我的集群或 Vnet/子网进行额外的配置更改?

我还创建了一个公共静态 IP 并分配给服务 yaml。这个静态 IP 我还作为环境变量在部署文件中传递,以便其他 WCF 微服务知道它们需要与之通信的 IP 地址。

PS Azure:\> kubectl get service myservice --watch
NAME                TYPE           CLUSTER-IP   EXTERNAL-IP      PORT(S)                                                                         AGE
myservice   LoadBalancer   10.0.0.50    20.185.104.254   9163:30733/TCP,23010:30526/TCP   2d8h
PS Azure:\> kubectl describe service myservice
Name:                     myservice
Namespace:                default
Labels:                   app=myservice
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"app":"myservice"},"name":"myservice","namespac...
Selector:                 app=myservice
Type:                     LoadBalancer
IP:                       10.0.0.50
LoadBalancer Ingress:     20.185.104.254
Port:                     svcproxy  9163/TCP
TargetPort:               9163/TCP
NodePort:                 svcproxy  30733/TCP
Endpoints:                <none>
Port:                     banyan  23010/TCP
TargetPort:               23010/TCP
NodePort:                 banyan  30526/TCP
Endpoints:                <none>
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>
Azure:/

预期 - 应该能够 ping 外部 IP。

实际 - 无法做到 100% 丢包

C:\windows\system32>ping 20.185.104.254

Pinging 20.185.104.254 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 20.185.104.254:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

【问题讨论】:

    标签: kubernetes kubernetes-ingress kubernetes-service


    【解决方案1】:

    检查您的入站防火墙规则。您很可能已阻止入站流量。

    【讨论】:

      猜你喜欢
      • 2023-03-16
      • 2020-06-02
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 2016-12-30
      相关资源
      最近更新 更多