I have been studying how kubernetes pod communication works across nodes and here is my intake so far:
Basically, the following figure describes. how each pod has network interface eth0 that is linked to the veth and than bridged to the hosts eth0 interface.
One way to make cross node communication between pods is by configuring routing tables accordingly.
let's say Node A has address domain 10.1.1.0/24 and Node B has address domain 10.1.2.0/24.
I can configure routing tables on node A to forward trafic for 10.1.2.0/24 to 10.100.0.2(eth0 of node B), and similar for node B to forward traffic for 10.1.1.0/24 to 10.100.0.1 (eth0 of node A)
This can work if my nodes aren't sperated by routers or if the routers are configured accordingly because they will otherwise drop packets that have private ip address as destination, This is isn't practical!
And here we get to talk about SDN which I am not clear about and is apparently the solution. Asfar as i know the SDN encapsulates packets to set a routable source and destination Ips
So basically to deploy A Container network plugin on kubernetes which creates an SDN, you basically create daemon sets and other assisting kubernetes objects.
My question is:
How do those daemon sets replace the routing tables modifications and make sure pods can communicate across nodes?
How do daemon sets wich are also pods, influence the network and other pods which have diffrent namespaces?
How do those daemon sets replace the routing tables modifications and make sure pods can communicate across nodes?
Networking can be customized with a kubenet-plugin or a CNI-plugin as described in Network Plugins to the kubelet that runs on every node. The Network Plugin is responsible for handling the routing, possibly by using kube-proxy. E.g. Cilium CNI plugin is a complete replacement of kube-proxy and is using eBPF instead of iptables.
How do daemon sets wich are also pods, influence the network and other pods which have diffrent namespaces?
Yes, DaemonSet is normal pods. Kubelet is a special node-component that manage pods, except containers not created by Kubernetes.
Life of a packet is a recommended presentation about Kubernetes Networking