AliyunContainerService / k8s-for-docker-desktop

为Docker Desktop for Mac/Windows开启Kubernetes和Istio。
https://yq.aliyun.com/articles/672675
4.94k stars 1.12k forks source link

在一个 pod 中, 无法 ping 通同一个命名空间下的 service 的 cluster IP #232

Open nimo10050 opened 9 months ago

nimo10050 commented 9 months ago

环境

mac book pro2018( intel 处理器) Docker Desktop (Engine: 24.0.2) Kubernetes: v1.25.9

现象

default 命名空间下, 有一个 test-nginx 的 pod , 有一个 hello-nginx 的 service

nimo@MacbookPro ~ % kubectl get svc
NAME          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
hello-nginx   ClusterIP   10.105.66.131   <none>        8080/TCP   84m
kubernetes    ClusterIP   10.96.0.1       <none>        443/TCP    13d
my-nginx      ClusterIP   10.100.123.87   <none>        88/TCP     4d10h

pod 里面, 无法通过 cluster ipservice name, ping 通 service

root@test-nginx:/etc# ping hello-nginx
PING hello-nginx.default.svc.cluster.local (10.105.66.131) 56(84) bytes of data.
^C