Calico Networking Option
Circumstance
Our on-premise environment consists of several VLAN(layer 2 network), each VLAN is created by VCenter. Physically, every VLAN is based on several baremetal machines on the same floor, the baremetal machines are connected by ethernet switches. And we have several floors of baremetal machines, they’re connected by ToR(Top of Rack) routers(layer 3 network).
Standardized Glossary
layer 3
In many on-premise data centers, each server connects to a top-of-rack (ToR) router operating at the IP layer (layer 3). In that situation, we would need to peer each node with its corresponding ToR router, so that the ToR learns routes to the containers.
In this circumstance, you need to Configure BGP peering.
On top of the advantages of non-peered unencapsulated traffic:- Your cluster can span multiple L2 subnets without needing encapsulation
- Resources outside your cluster can talk directly to your pods without NAT
- You can even expose pods directly to the internet if you want!
layer 2
Since we are running in an VLAN within a single subnet(on the same floor), the hosts have ethernet (layer 2) connectivity with one another, meaning there are no routers between them. Thus, they can peer directly with each other.
If we spread k8s nodes(calico workloads) into several VLAN(subnet), we need either to configure peer over BGP with your routers or cross-subnet encapsulation.overlay/encapsulation
Although the official project recommends running Calico without network overlay/encapsulation, becase that provides the highest performance adn simplest network.
However, if you are not familiar with physical network devices and infrustructure or you are going to use Calico in a public cloud like AWS, you can also use the overlay networking.
Calico can perform encapsulation on: all traffic, no traffic, or only on traffic that crosses a subnet boundary.-
An autonomous system (AS) is a collection of connected Internet Protocol (IP) routing prefixes under the control of one or more network operators on behalf of a single administrative entity or domain that presents a common, clearly defined routing policy to the internet.[^1]
Footnote
[^1]: multihomed: An AS that maintains connections to more than one other AS. This allows the AS to remain connected to the internet in the event of a complete failure of one of their connections. However, unlike a transit AS, this type of AS would not allow traffic from one AS to pass through on its way to another AS.