Answer a question

I have a service running on kubernetes exposed via nodeport like so:

test-service                        NodePort    100.100.246.5     <none>        30005:30005/TCP

That service is reachable from other nodes and is working properly; however, I don't see see that kubernetes listening on that port if I do a netstat -tunlp | grep 30005.

I have External Traffic Policy: Local, and if I understand correctly that should mean that the node with the pod on it should be listening on said port? Again, everything works, but I'm trying to figure out why I cannot see the port listening on the host.

Answers

Kubernetes services are not implemented as processes listening on a specific port. Instead iptables (or IPVS) is used and services are basically iptables rules. That's why they won't show up in your netstat. You can find more info about it here.

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐