Ref:
- We have two worker nodes, able to communicate with each other.
- Each nodes have multiple pods running and each pod is able to communicate with any other pod in any other node(till node is accessible)
3 Basic requirements that kubernetes has put are:
* all containers can communicate with all other containers without NAT
* all nodes can communicate with all containers (and vice-versa) without NAT
* the IP that a container sees itself as is the same IP that others see it as
-
This networking of kubernetes can be done in multitude of way.
-
See https://kubernetes.io/docs/concepts/cluster-administration/networking/ with heading How to implement the Kubernetes networking model
-
You can see one simple example in this video: https://www.youtube.com/watch?v=WwQ62OyCNz4
-
Or this (https://github.com/cloudnativelabs/kube-router/blob/master/docs/how-it-works.md)[https://github.com/cloudnativelabs/kube-router/blob/master/docs/how-it-works.md] (used widely)
All in all, if we want to go underneath we can, but for just learning, we can assume that above 3 basic conditions are taken care of and our cluster will work. How it works, we can do that with different networking topology for nodes, with satisfy this property.