Slide 1

Slide 1 text

Beyond the Buzzword: BPF’s unexpected role in Kubernetes November 19, 2020 Andrew Randall Alban Crequy

Slide 2

Slide 2 text

What is (e)BPF? custom programs that run in the Linux kernel hooks and data structures (maps) restricted virtual machine sandbox + code verifier (extended) Berkeley Packet Filter

Slide 3

Slide 3 text

Why do you care? fast, customizable networking debugging / performance analysis application monitoring & security

Slide 4

Slide 4 text

Evolution of (e)BPF 2.1.75 first BPF support Dec 1997 3.15 new JIT compiler → eBPF Jun 2014 IO Visor project established Aug 2015 4.8 eXpress Data Path (XDP) Oct 2016 4.11 BPF datastructures for improved packet filtering May 2017 May 2018 Katran announced by Facebook Nov 2017 4.14 fast intra- host networks (sockmap) 4.18 bpf filter by cgroups (containers) Aug 2018 Aug 2020 5.8 BPF ring buffers

Slide 5

Slide 5 text

An eBPF OSS Landscape Low-level tools Security & Networking Visibility bcc bpftrace cilium falco katran llvm API Libraries gobpf ebpf libbpf libbpf-rs red-bpf calico polycube skydive hubble weave scope kubectl- trace kubectl- gadget kernel tools e.g. bpftool tcptracer-bpf Other ply pyebpf

Slide 6

Slide 6 text

Hubble

Slide 7

Slide 7 text

Hubble

Slide 8

Slide 8 text

Weave Scope

Slide 9

Slide 9 text

IOvisor BPF Compiler Collection (bcc)

Slide 10

Slide 10 text

bpftrace

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Enter: Inspektor Gadget a “swiss army knife” collection of various bpf tools (gadgets) some from bcc + some new ones developed by kinvolk

Slide 13

Slide 13 text

What do we need for Kubernetes? granularity: “pod, not pid” aggregation by label selectors kubectl-like experience

Slide 14

Slide 14 text

K8s integration My laptop $ kubectl gadget... kubectl-gadget Kubernetes Control Plane (API Server, scheduler, ...) exec client plugin worker node “gadget” pod exec traceloop & bcc kernel Install BPF program Deploy gadget pods Kubernetes cluster Create DaemonSet kubectl-exec

Slide 15

Slide 15 text

Gadgets available today profile network policy advisor traceloop tcptop tcptracer opensnoop execsnoop bindsnoop capabilities kubectl-gadget

Slide 16

Slide 16 text

Demo kubectl demo

Slide 17

Slide 17 text

No content