How does a packet travel from one pod to another pod on a different node with an overlay network?
AdvancedConceptKubernetes, Containers, MTU & Performance Basics
Answer
The source pod sends to the destination pod IP via its veth pair to the node. The node's routing sends it to the overlay device (VXLAN flannel.1 or similar), which encapsulates the packet in UDP (8472 or 4789) addressed to the destination node's IP. The remote node decapsulates and delivers to the pod's veth.
Encapsulation adds about 50 bytes, so the pod MTU must be reduced (for example 1450) to avoid fragmentation. Without overlay (BGP or VPC CNI) the node just routes the packet.
More on Kubernetes, Containers, MTU & Performance Basics
What are the basic Kubernetes networking rules?BeginnerWhat are the Service types in Kubernetes?BeginnerWhat is the difference between a Service and an Ingress?BeginnerHow does kube-proxy implement Services?AdvancedHow does DNS work for Services and pods in Kubernetes?IntermediateWhat is a CNI plugin and how do the main ones differ?Intermediate