Slide 1

Slide 1 text

Kubernetes-based Event Driven Autoscaling Erwin Staal | @erwin_staal

Slide 2

Slide 2 text

Kubernetes-based Event Driven Autoscaling Event-driven Autoscaling Made Simple Built-in Scalers

Slide 3

Slide 3 text

@erwin_staal About me Erwin Staal Software engineer DevOps Consultant

Slide 4

Slide 4 text

@erwin_staal Containers? A lightweight, stand-alone, executable package of • Code • Runtime • System tools • System libraries • Settings • …

Slide 5

Slide 5 text

@erwin_staal Kubernetes in 5 minutes Worker K Master API application.yaml Worker K Worker K P1-r1 P1-r2 P1-r3 kind: Deployment spec: template: spec: containers: - name: grafana image: grafana/grafana ports: - containerPort: 3000 replicas: 3

Slide 6

Slide 6 text

@erwin_staal Scaling Horizontal Vertical

Slide 7

Slide 7 text

@erwin_staal Autoscaling in Kubernetes Nodes Pods Horizontal # of nodes # of pods Vertical size of node size of pod

Slide 8

Slide 8 text

@erwin_staal Kubernetes Event-Driven Autoscaling • Install into any cluster • Extensible and pluggable scalers to grab metrics from any event source • Monitors the rate of events to proactively scale any container • Feeds the data into the Kubernetes APIs to drive scaling • Allows containers to scale to and from zero • It is up to the deployment to consume the events from source

Slide 9

Slide 9 text

@erwin_staal It’s your queue KEDA Queue App 1 2 3 Alternative Queue App 1 3 HTTP Scale 2

Slide 10

Slide 10 text

@erwin_staal

Slide 11

Slide 11 text

@erwin_staal Scalers AWS Kinesis Stream Apache Kafka Topic AWS Cloudwatch AWS SQS Queue Azure Blob Storage Azure Event Hubs Azure Service Bus Azure Storage Queue External Google Cloud Platform Pub/Sub Huawei Cloudeye Liiklus Topic NATS Streaming RabbitMQ Queue Prometheus Redis Lists

Slide 12

Slide 12 text

@erwin_staal AKS + Virtual nodes Azure Kubernetes Services Azure Container instances kind: Deployment spec: template: spec: containers: - name: grafana image: grafana/grafana

Slide 13

Slide 13 text

@erwin_staal DEMO

Slide 14

Slide 14 text

@erwin_staal K3s and K3d? • K3s - 5 less than K8s • Flannel • CoreDNS • Traefik • SQLite • Containerd “k3d is a utility designed to easily run k3s in Docker, it provides a simple CLI to create, run, delete a full compliance Kubernetes cluster with 0 to n worker nodes.”

Slide 15

Slide 15 text

@erwin_staal Horizontal Pod Autoscaler (HPA) Scrapes metrics Scales Metrics Polls App

Slide 16

Slide 16 text

@erwin_staal DEMO

Slide 17

Slide 17 text

@erwin_staal Thanks! Erwin Staal [email protected] @erwin_staal