| I was assuming since tasqa wanted to know, how it works on baremetal in contrast to on the cloud. And since they brought network virtualisation up, that they were already knowledgeable about the networking part. Networking is handled in kubernetes with CNI plugins, Calico is one of them.
They define how one pod can talk to another. Probably best described in how it does it is by the project itself: https://docs.projectcalico.org/about/about-networking My simplyfied version: Calico uses the IP routing facilities to route IP packets to pods over hosts. Either from another pod or from a gateway router. BGP is a protocol to exchange routing information, so it can be used to inform the router or kubernetes nodes (in this case physical hosts) about where to send the IP packets. If a pod is running on a node, the node announces with BGP that the pod IP can be routed over the IP of the node.
If the pod provides a service (in the kubernetes sense), the node can also announce that the service IP can be routed over the same host.
Now, if two pods on different nodes are providing the same service, then both are announcing the same service IP. So, there are multiple routes or multiple paths for the same IP. That are the last to letters of the acronym ECMP (Equal Cost Multiple Path). Equal cost, because we do not express a preference over one or the other. The router then can make a decision where to send the packets to. Usually that is done by hashing some part of the IP packet (IP and port of source and target for example). Now the question is how is that hash deciding to which host it goes?
In most cases it is very simply that you have an array of hosts, and the hash modulo the length gives you the host.
Problem is, if you add or remove one item from that, practically all future packets will end up at a different host than before you did so. And they don't know what to do with it, breaking the connection (in case of TCP).
Resilient hashing describes a feature that the mapping won't change under changes. |