Skip to content

How container ports are mapped to pod's ip? #2686

Closed Answered by dzhlobo
dzhlobo asked this question in Q&A
Discussion options

You must be logged in to vote

I didn't know how networking in cluster works.

My assumption was that all the ip addresses is allocated to node and then traffic from containers in pods were routed correctly using NAT configured on node.

It's not the case. Each pod has its own network namespace (shared between all pod's containers). In the namespace there is a network interface with an ip address configured. In case of VPC CNI this is a real address from a VPC. So when a process in container listens to a port it listens to a port on a network interface in the namespace, no mapping is configured at all.

I don't know exactly how VPC CNI plugin works and how prefix delegation in VPC works but I imagine it is possible to cre…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dzhlobo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant