Cilium breadcrumbs 2
Cilium breadcrumbs 2
Last week I posted main components of Cilium within Kubernetes. This week's breadcrumbs are about routing modes.
Routing modes refer to how packets sent from a pod arrive to their destination. Cilium supports two routing modes.
- Native mode: It's best for performance. The packet sent by the pod is untouched, so source IP is the pod's IP. For this to work you need a routing protocol, the network must know how to route one packet from pod x in Node 1 to pod y in Node 2 for example. This option is less cloud-friendly and for making your network aware of how to send a packet from Node 1 to Node 2, Cilium can use BGP Peering Protocol or you can place a router with static routes for example.
- Encapsulation mode (Default mode): This is less performant due to encapsulation overhead. Basically the packet sent from the pod has the pod's source IP. However, when the packet leaves the node, the packet gets wrapped by the Node's information. So source IP is now Node 1's IP. Responses follow the reverse path, when the packet arrives to Node 1, it gets unwrapped and resent to the origin pod who sent the packet. In this mode, no router configuration is needed.
I recommend sticking to the encapsulation mode, which is the default is normal scenarios and just go into native mode when you need to squeeze performance.
I'm creating these breadcrumbs about what I know with the goal of teaching stuff quickly, kind of a knowledge snack. If you like this kind of information, consider to give the post some love by reacting or commenting on it or even sharing with your people. Feel free to follow!