Why kubernetes doesn't provide pod-to-pod communication?

5/30/2019

While trying to understand Kubernetes networking, one point has confused me. Why Kubernetes doesn't handle pod-to-pod communication inbuilt/itself?

As per the docs - https://kubernetes.io/docs/concepts/cluster-administration/networking/

There are 4 distinct networking problems to address:

  1. Highly-coupled container-to-container communications: this is solved by pods and localhost communications.
  2. Pod-to-Pod communications: this is the primary focus of this document.
  3. Pod-to-Service communications: this is covered by services.
  4. External-to-Service communications: this is covered by services.

When Kubernetes can handle all the other problems(mentioned above) of networking, why does pod-to-pod communication needs to handled by other plugins like ACI, Cilium, Flannel, Jaguar and so on..

Would like to know is there any specific reason for such architecture?

-- Here_2_learn
kubernetes
networking

2 Answers

6/4/2019

Agree with Tim above. Kubernetes in general is mostly an abstraction and orchestration layer of the Compute, storage and networking for the developers so that they don't have to be aware of the implementation. The implementation itself will be tied to the underlying infrastructure and kubernetes just defines the interface for them (CRI for containers -compute, CSI for storage and CNI for networking).

By just defining the interface the implementations can evolve independently without breaking the contract. For example, in future it might become possible to offload pod-to-pod networking to the nic-card and expecting kubernetes to evolve to such a technology change might be a big ask. By not being intimately tied to the implementation it allows development of technology to be accelerated in each layer.

-- Mohana Kumar
Source: StackOverflow

6/4/2019

The short answer is that networks are complex and highly customized. It's not easy to provide an efficient built-in that works everywhere. All of the cloud provider networks are different than bare-metal networks. Rather than pick a bad default we require that the end user, who really is the only person who could possibly comprehend their network, makes a decision.

Doing a built-in VXLAN or something might be possible but would be far from ideal for many users, and defaults tend to stick...

-- Tim Hockin
Source: StackOverflow