Skip to content

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

@nimo10050

Description

@nimo10050

环境

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions