Does K8s run on plain Layer2 network infrastructure?

12/20/2020

Does K8s run on a plain Layer2 network with no support for Layer3 routing stuff?!? Im asking as I want to switch my K8s envirnoment from cloud VMs over to Bare Metal and Im not aware of the Privat-network Infrastrcture of the hoster ...

Kind regards and thanks in advance

-- user14389292
kubernetes
networking

1 Answer

12/20/2020

Kubernetes will run on a more classic, statically defined network you would find on a private network (but does rely on layer 4 networking).

A clusters IP addressing and routing can be largely configured for you by one of the CNI plugins that creates an overlay network or can be configured statically with a bit more work (via kubenet/IPAM).

An overlay network can be setup with tools like Calico, Flannel or Weave that will manage all the routing in cluster as long as all the k8s nodes can route to each other, even over disparate networks. Kubespray is a good place to start with deploying clusters like this.

For a static network configuration, clusters will need permanent static routes added for all the networks kubernetes uses. The "magic" cloud providers and the overlay CNI plugins provide is to is to be able to route all those networks automatically. Each node will be assigned a Pod subnet and every node in the cluster will need to have a route to those IP's

-- Matt
Source: StackOverflow