Event Driven Autoscaling using KEDA - MVP

nileshgule 35 views 21 slides Sep 02, 2024
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

Slidedeck used during the COding Night NZ sesison on 2 September 2024. The recording of the session is available on YouTube
https://www.youtube.com/live/a8gwqaJR1Ck?si=V9iskiZQCUHOvgzj


Slide Content

Event Driven Autoscaling
using
KEDA
Nilesh Gule @nileshgule

$whoami
{
“name”: “Nilesh Gule”,
“website” : “https://www.HandsOnArchitect.com",
“github” : “https://GitHub.com/NileshGule"
“twitter” : “@nileshgule”,
“linkedin” : “https://www.linkedin.com/in/nileshgule”,
“YouTube” : “https://www.YouTube.com/@nilesh-gule”
“likes” : “Technical Evangelism, Cricket”,
}

@nileshgule
KEDA
Kubernets based Event Driven Autoscaling
Scaling in Kubernetes KEDA Overview
TechTalks demo with RabbitMQ Autoscaling with KEDA
KEDA Architecture
Agenda

Pre-requisites
•Self contained application with all its
dependencies
Docker
•Orchestrates containers
•Self healing
•Service discovery
•Scaling
Kubernetes
•Dockerhub / private container registry
•Repository for storing container images
Container Registry
•Managed Kubernetes service on Azure
•Native integration with other Azure services like Azure Active
Directory (AAD), Azure Container registry (ACR), Azure
Container Instances (ACI), Azure Monitor etc.
Azure Kubernetes Service (AKS)

Kubernetes scaling options
Horizontal Pod
Autoscaler
Vertical Pod
Autoscaler
Cluster AutoscalerManual

TechTalks Application Architecture
TechTalks ConsumerTechTalks Producer
TechTalks Frontend (UI)
Message Broker
Polyglot
Programming

Techtalks-producer
Azure-Melbourne-cluster
demo-azure-melbourne-rg
ngacrregistry
acrResourceGroup
Techtalks-consumer
TechTalks without KEDA

@nileshgule
Demo

Problem statement
•Unpredictable workload
•Special events (Christmas / New Year / Diwali / Deepavali / Thanksgiving etc.)
•Scale based on factors outside of Kubernetes cluster
•Scale based on combination of factors
•Unexpected event (large number of logs compared to normal)

@nileshgule
Demo KEDA in action

Techtalks-producer
Azure-Melbourne-cluster
demo-azure-melbourne-rg
ngacrregistry
acrResourceGroup
Techtalks-consumer
TechTalks with KEDA - AKS

KEDA Architecture

ScaledObject
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: rabbitmq-consumer
namespace: default
labels:
deploymentName: rabbitmq-consumer-deployment
spec:
scaleTargetRef:
deploymentName: rabbitmq-consumer
pollingInterval: 5 # Optional. Default: 30 seconds
cooldownPeriod: 30 # Optional. Default: 300 seconds
minReplicaCount: 1 # Optional. Default: 0
maxReplicaCount: 30 # Optional. Default: 100
triggers:
- type: rabbitmq
metadata:
queueName: techtalks-consumer-techtalks
queueLength : ‘5’
authenticationRef:
name: trigger-auth-rabbitmq-host

KEDA Features

Run Containers at scale
❖KEDA supported scale triggers including Azure Event Hub,
Apache Kafka, RabbitMQ, MongoDB, MySQL, PostgreSQL
etc.
❖Robust autoscaling without managing complex
infrastructure
❖Scale to zero and pay only for use by the second
https://keda.sh/docs/2.15/scalers/

Summary
•KEDA helps to auto scale on metrics external to Kubernetes
•KEDA does not modify the behavior of the application
•Application designed using cloud native approach are more suited
for KEDA integrations
•KEDA helps to auto scale on composite metric
•KEDA supports authentication providers

References
https://www.youtube.com/@nilesh-gule
https://dapr.io/
Dapr Publish and Subscribe
Kubernetes Event Driven Autoscaling
Serverless - Dapr and Azure Container Apps

Containerize Apps Resources
https://github.com/NileshGule/pd-tech-fest-2019
https://github.com/NileshGule/cloud-native-ninja
https://github.com/NileshGule/techtalks-azure-container-apps-demo
Pd tech fest 2019 : https://github.com/NileshGule/pd-tech-fest-2019
Cloud Native Ninja : https://github.com/NileshGule/cloud-native-ninja
Azure Container Apps : https://github.com/NileshGule/techtalks-azure-container-apps-demo
Slides
https://www.slideshare.net/nileshgule/
Slideshare: https://www.slideshare.net/nileshgule/
https://speakerdeck.com/nileshgule/
Speaker Deck: https://speakerdeck.com/nileshgule/

Nilesh Gule
ARCHITECT | MICROSOFT MVP
“Code with Passion and
Strive for Excellence”
nileshgule
@nileshgule Nilesh Gule
NileshGule
www.handsonarchitect.com
https://www.youtube.com/@nilesh-gule

#GlobalAzure
Q&A