Bazel & Kubernetes: Develop like it’s production

A presentation at BazelCon 2019 in December 2019 in Sunnyvale, CA, USA by Steeve Morin

Slide 1

Slide 1

Bazel & Kubernetes: Develop like it’s production Steeve Morin - @steeve

Slide 2

Slide 2

ZENLY MAKES IT FUN & EASY TO KNOW WHAT YOUR FRIENDS AND FAMILY ARE UP TO

Slide 3

Slide 3

RULES_K8S KUBERNETES DAG DSL REGULAR BAZEL TARGETS ONE DAG TO RULE THEM ALL k8s_object( name = “api.k8s”, template = “deployment.yaml”, ) k8s_objects( name = “api”, objects = [ “:api.k8s”, “:db”, “:queue”, “:svc1”, ], ) k8s_objects( name = “svc1”, objects = [ “:svc1.k8s”, “:db”, “:queue”, “:svc2”, ], )

Slide 4

Slide 4

K3S: 5 LESS THAN K8S LIGHTWEIGHT K8S DISTRO RUNS IN DOCKER 😱 $ bazel run //:k3s RUNS LOCALLY GUI VIA derailed/k9s $ bazel run //:k9s

Slide 5

Slide 5

SOURCE > BUILD > DEPLOY $ bazel run //:api.apply ONE COMMAND BUILD + DEPLOY ALWAYS CORRECT SERVICES INIT WITH CODE DB SCHEMA

Slide 6

Slide 6

TESTING $ bazel test //… TEST BINARY AS K8S JOB SERVICE DAG AWARE SUCCESS / FAILURE 🙂 LOGS 🙂 TEST ARGUMENTS 🙁 FLAKINESS DETECTION 🙁

Slide 7

Slide 7

VPN & REMOTE CLUSTER SAME WORKFLOW DNS FORWARDING OPENVPN + QR CODE

Slide 8

Slide 8

THANK YOU Steeve Morin (@steeve)