Kubernetes Networking: Marian Babik, Spyridon Trigazis Cern
Kubernetes Networking: Marian Babik, Spyridon Trigazis Cern
2
Network engineer(s) ?
Container Platform of
Choice
3
Containers and Pods
Container - regular process created by using two Linux Kernel
features - namespaces and cgroups
Namespaces - provides means of isolation to a process, e.g.
IPC, Network, PID, UTS, Users and Mount
Cgroups - way to manage/share resources for a collection of
processes (CPU, Memory, Network, etc.)
5
Container Networking - Multi-host
Basically there are two options:
There are many existing CNI implementations, which are part of the Cloud-Native
Networking landscape
7
Cloud Native Networking
Range of approaches, both open-source (white) and commercial (grey) exist,
tracked by the Cloud Native Computing Foundation
Provides layer 3 IPv4-only network between multiple nodes using several different
backends.
The recommended choice is the VXLAN (where only one vxlan network is
created), host-gw (for direct routing, remote gw must be reachable via layer-2),
UDP (for debugging purposes)
9
Tigera’s Calico
IP routed fabric that can work both on top layer-2 or layer-3 only networks and
uses BGP peering to integrate
Four basic components:
10
Contiv/VPP
Contiv is a networking solution that directly integrates with Cisco Application
Centric Infrastructure, it supports Kubernetes and OpenShift only.
● Using VLANs directly configured on the switches to interconnect the
containers
○ with integration at the container level networking - docker network/linux bridge
● eBGP peering for layer-3
○ Communication between containers on different hosts runs natively using VLANs
○ Communication between container and non-containers is done by BGP peering
● FD.io VPP extension
○ Open source implementation of the Cisco’s Vector Packet Processing (VPP) technology.
○ Accelerated by DPDK - software switch runs as another container in Kubernetes
11
Cilium
Cilium operates at Layer 3/4 for networking
and Layer 7 for applications.
12
Kube-router
Kube-router uses iptables, ipvs/lvs, ipset
and iproute2, not new CNI plugin.
13
Performance evaluation
https://itnext.io/benchmark-results-of-kubernetes-network-plugins-cni-over-10gbit-s-network-updated-april-2019-4a9886efe9c4 14
Performance evaluation @CERN (specs)
Motivation: Use cases like accessing storage systems (eos, cephfs) or DBs
15
Performance evaluation @CERN (results)
16
Linux packet processing
Linux kernel bypass models - improve networking performance by going
around the Linux networking stack (needs modified device drivers), e.g.
● Intel Data Plane Development Kit (DPDK) -
● VPP (FD.io) - open source version of the Cisco’s vector packet processing
But also, e.g OpenDataPlane, OpenFastPath, netmap, Snabb, pf_ring, etc.
Linux kernel fast path models, which try to process as much data early on the
data path as possible, in Linux driver code or on NIC itself:
● eBPF - extended Berkeley Packet Filter (BPF)
● XDP - eXpress Data Path -
○ uses eBPF programs and performs processing RX packet-pages directly before the driver. It
can run as native or offloaded (BPF in NIC, or via DPDK).
Plan is to try additional tests/benchmarks and publish our results (in a blog)
Try Cilium and Kube-router, test accessing remote filesystem and mysql
18
References
[0] Cilium webinar https://www.cncf.io/webinars/how-cilium-uses-bpf-to-supercharge-kubernetes-networking-security/
[1] Cilium docs https://docs.cilium.io/en/v1.6/concepts/networking/
[2] Calico docs https://docs.projectcalico.org/v3.11/introduction/
[3] Flannel docs https://github.com/coreos/flannel#documentation
[4] CNI benchmark https://itnext.io/benchmark-results-of-kubernetes-network-plugins-cni-over-10gbit-s-network-36475925a560
[5] kube-router docs https://www.kube-router.io/docs/user-guide/#try-kube-router-with-cluster-installers
19