<p>I have been studying how kubernetes pod communication works across nodes and here is my intake so far:</p>
<p>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.</p>
<p>One way to make cross node communication between pods is by configuring routing tables accordingly.</p>
<p>let's say Node A has address domain 10.1.1.0/24 and Node B has address domain 10.1.2.0/24.</p>
<p>I can configure routing tables on node A to forward traffic 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)</p>
<p>This can work if my nodes aren't seperated 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!</p>
<p><a href="https://i.stack.imgur.com/Cwd7c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cwd7c.png" alt="enter image description here" /></a></p>
<p>And here we get to talk about SDN which I am not clear about and is apparently the solution.
As far as I know the SDN encapsulates packets to set a routable source and destination Ips</p>
<p>So basically to deploy A Container network plugin on kubernetes which creates an SDN, you basically create daemon sets and other assisting kubernetes objects.</p>
<p>My question is:</p>
<p>How do those daemon sets replace the routing tables modifications and make sure pods can communicate across nodes?</p>
<p>How do daemon sets which are also pods, influence the network and other pods which have different namespaces?</p>

<blockquote>
  <p>How do those daemon sets replace the routing tables modifications and make sure pods can communicate across nodes?</p>
</blockquote>

<p>Networking can be customized with a <em>kubenet-plugin</em> or a <em>CNI-plugin</em> as described in <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/" rel="nofollow noreferrer">Network Plugins</a> to the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/" rel="nofollow noreferrer">kubelet</a> that runs on every node. The Network Plugin is responsible for handling the routing, possibly by using <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/" rel="nofollow noreferrer">kube-proxy</a>. E.g. Cilium CNI plugin is a <a href="https://cilium.io/blog/2019/08/20/cilium-16/" rel="nofollow noreferrer">complete replacement of kube-proxy</a> and is using <a href="https://cilium.io/blog/2018/04/17/why-is-the-kernel-community-replacing-iptables/" rel="nofollow noreferrer">eBPF instead of iptables</a>.</p>

<blockquote>
  <p>How do daemon sets wich are also pods, influence the network and other pods which have diffrent namespaces?</p>
</blockquote>

<p>Yes, <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSet</a> is normal pods. Kubelet is a special <a href="https://kubernetes.io/docs/concepts/overview/components/#node-components" rel="nofollow noreferrer">node-component</a> that manage pods, except containers not created by Kubernetes.</p>

<p><strong><a href="https://www.youtube.com/watch?v=0Omvgd7Hg1I" rel="nofollow noreferrer">Life of a packet</a></strong> is a recommended presentation about Kubernetes Networking</p>
