Autoscale Applications
based on external events
with 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”,
“co-organizer” : “Azure Singapore UG”
}
@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 Autoscaler
Manual
TechTalks Application Architecture
TechTalks Consumer
TechTalks Producer
TechTalks Frontend (UI)
Message Broker
Polyglot
Programming
Dapr overview
Techtalks-producer
Azure-Singapore-cluster
demo-azure-singapore-rg
ngacrregistry
acrResourceGroup
Techtalks-consumer
TechTalks with Dapr - AKS
@nileshgule
Demo KEDA in action
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: hello
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.11/scalers/
Summary
• Modern applications are loosely coupled and highly portable
• AKS provides native integrations to Dapr and KEDA
• KEDA helps to auto scale on metrics external to Kubernetes
• Dapr tries to simplify the Microservices development and
deployment
• Dapr Components help to extract underlying functionality and
provides abstractions
• Make app portable to run in serverless as well as managed cloud
services
References
https://www.youtube.com/@nilesh-gule
https://dapr.io/
Dapr Publish and Subscribe
Kubernetes Event Driven Autoscaling
Serverless - Dapr and Azure Container Apps
Comparison between ACA and AKS
Containerize Apps Resources
Cloud Native Ninja : https://github.com/NileshGule/cloud-native-ninja
Azure Container Apps : https://github.com/NileshGule/techtalks-azure-container-apps-demo
Slides
Slideshare: https://www.slideshare.net/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

Autoscale applications based on external events with KEDA.pdf

  • 1.
    Autoscale Applications based onexternal events with KEDA Nilesh Gule @nileshgule
  • 2.
    $whoami { “name” : “NileshGule”, “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”, “co-organizer” : “Azure Singapore UG” }
  • 4.
    @nileshgule KEDA Kubernets based EventDriven Autoscaling Scaling in Kubernetes KEDA Overview TechTalks demo with RabbitMQ Autoscaling with KEDA KEDA Architecture Agenda
  • 5.
    Pre-requisites • Self containedapplication 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)
  • 6.
    Kubernetes scaling options HorizontalPod Autoscaler Vertical Pod Autoscaler Cluster Autoscaler Manual
  • 7.
    TechTalks Application Architecture TechTalksConsumer TechTalks Producer TechTalks Frontend (UI) Message Broker Polyglot Programming
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
    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: hello queueLength : ‘5’ authenticationRef: name: trigger-auth-rabbitmq-host
  • 13.
  • 14.
    Run Containers atscale ❖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.11/scalers/
  • 15.
    Summary • Modern applicationsare loosely coupled and highly portable • AKS provides native integrations to Dapr and KEDA • KEDA helps to auto scale on metrics external to Kubernetes • Dapr tries to simplify the Microservices development and deployment • Dapr Components help to extract underlying functionality and provides abstractions • Make app portable to run in serverless as well as managed cloud services
  • 16.
    References https://www.youtube.com/@nilesh-gule https://dapr.io/ Dapr Publish andSubscribe Kubernetes Event Driven Autoscaling Serverless - Dapr and Azure Container Apps Comparison between ACA and AKS
  • 17.
    Containerize Apps Resources CloudNative Ninja : https://github.com/NileshGule/cloud-native-ninja Azure Container Apps : https://github.com/NileshGule/techtalks-azure-container-apps-demo Slides Slideshare: https://www.slideshare.net/nileshgule/ Speaker Deck: https://speakerdeck.com/nileshgule/
  • 18.
    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
  • 19.