Kubernetes nodeport not visible as listening on host but service working
Asked Answered
T

1

10

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.

Temuco answered 3/3, 2021 at 14:25 Comment(0)
F
17

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.

Feedback answered 3/3, 2021 at 15:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.