SlideShare a Scribd company logo
Event-driven Autoscaling
through KEDA and
Knative Integration
Daniel Oh
Senior Principal Developer Advocate
2
About Me
Daniel Oh
● Senior Principal Technical Marketing Manager at Red Hat
○ Cloud Native Runtimes
○ Serverless and Service Mesh practices
● Ambassador for CNCF and DevOps Institute
● Advisory Board Member of Global Skill Development Council
● Opensource.com Correspondents
● Public Speaker & Developer Advocate
● Published Author
○ Practical Ansible 2
○ Quarkus for Spring Developers
danieloh30
@danieloh30
bit.ly/danielohtv
3
Autoscaling Architecture on Kubernetes
4
Autoscaling Architecture on Kubernetes w/ External Services
5
6
7
● Project aims to make Kubernetes Event Driven Autoscaling dead simple
● Started as a partnership between Red Hat and Microsoft (Feb 2019)
● Donated into CNCF as a Sandbox project (Mar 2020)
● KEDA 2.0 brought major redesign (Nov 2020)
● Promoting to CNCF Incubation project (Aug 2021)
● KEDA 2.6 has been released recently (Feb 2022)
● https://keda.sh
8
● Automatically scale Kubernetes Deployments, Jobs & Custom Resources
● Provides 49+ built-in scalers, but users can build own external scalers
○ Kafka, Prometheus, RabbitMQ, AWS services, Azure Services,...
● Scale resources based on events in the target scalers, eg. messages in
Kafka topic
● KEDA does not manipulate the data, just scales the workload
● Installation through OLM Operator or Helm
https://keda.sh/docs/2.6/scalers/
9
10
How does KEDA works?
● KEDA is built on top of Kubernetes
● Use ScaledObject/ScaledJob to
define scaling metadata
● Manages workloads to scale to 0
● Registers itself as k8s Metric Adapter
● Provides metrics for Horizontal Pod
Autoscaler (HPA) to scale on
11
ScaledObject
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: example-so
spec:
scaleTargetRef:
name: example-deployment
minReplicaCount: 0
maxReplicaCount: 100
triggers:
- type: kafka
metadata:
bootstrapServers: kafka.svc:9092
consumerGroup: my-group
topic: test-topic
lagThreshold: '5'
● Can target Deployment, StatefulSet or
Custom Resource with scale
● Multiple scalers can be defined as
triggers for the target workload
● User can specify HPA related settings
to tweak the scaling behavior
12
How about Serverless
Autoscaling?
13
14
● Operates on standard k8s resources
● Can scale existing deployed apps
● Pull based approach
● Doesn’t manage data delivery
● K8s Horizontal Pod Autoscaler (HPA)
● Focus is on event driven autoscaling
● Operates on Knative Service
● Existing apps must be converted
● Push based approach
● Manages data delivery (Eventing)
● Knative Autoscaler
● Demand-based autoscaling (HTTP)
15
Use Case #1
Application consuming messages from Kafka topic
● Application is deployed as
standard Kubernetes Deployment
● Can be autoscaled only via
standard k8s HPA: CPU & Memory
● No event-driven autoscaling
Kubernetes
Deployment
Application
Consumes
messages
#Demo
17
● Application remains the same and is being
deployed the same way
● Event-driven autoscaling enabled through
KEDA
Scales
Kubernetes
Deployment
Application
Consumes
messages
Scrapes
metrics
Kubernetes
Deployment
Application
Kubernetes
Deployment
Application
Use Case #2
Redesigned to utilize KEDA
#Demo
19
● Application needs to be rewritten from Kafka
consumer to CloudEvents consumer
● Application needs to be redeployed as Knative
Service
● Needs Knative Eventing Kafka Source
● Event-driven autoscaling enabled through
Knative Autoscaler
Consumes
messages
Knative
Eventing
Kafka Source
Knative
Service
Application
Sends
CloudEvents
Monitors load
&
scales
Knative
Service
Application
Knative
Service
Application
Use Case #3
Redesigned to utilize Knative
#Demo
21
How about Serverless
Autoscaling?
Event-driven
22
Integrate KEDA with
Knative
23
● KEDA can be used to autoscale Knative Eventing Infrastructure
○ Knative Eventing Sources, Channels
○ Autoscaling allows infrastructure to handle higher loads or save
resources (by scaling to 0) when idle
● KEDA could be potentially used to scale Knative Service, in case users
don’t want to utilize Knative Eventing for event driven workloads
(currently not implemented)
KEDA and Knative Integration
24
● Application deployed as Knative
Service and autoscaled by Knative
● Knative Eventing Infrastructure -
Kafka Source is autoscaled by KEDA
Consumes
messages
Knative
Eventing
Kafka Source
Knative
Service
Application
Sends
CloudEvents
Monitors load
&
scales
Knative
Service
Application
Knative
Service
Application
Scrapes
metrics
Knative
Eventing
Kafka Source
Knative
Eventing
Kafka Source
Scales
Use Case #4
Redesigned to utilize Knative and KEDA
#Demo
26
knative-sandbox/eventing-autoscaler-keda
metadata:
annotations:
autoscaling.knative.dev/class: keda.autoscaling.knative.dev
autoscaling.knative.dev/minScale: "0"
autoscaling.knative.dev/maxScale: "5"
keda.autoscaling.knative.dev/pollingInterval: "30"
keda.autoscaling.knative.dev/cooldownPeriod: "30"
# Kafka Source
keda.autoscaling.knative.dev/kafkaLagThreshold: "10"
# AWS SQS Source
keda.autoscaling.knative.dev/awsSqsQueueLength: "5"
# Redis Stream Source
keda.autoscaling.knative.dev/redisStreamPendingEntriesCount: "5"
● KafkaSource
● AWS SQS Source
● Redis Stream Source
● RabbitMQ Broker
https://github.com/knative-sandbox/eventing-autoscaler-keda
27
Keep Learning!
bit.ly/danielohtv
Takeaways
28
▸ KEDA - Kubernetes event driven autoscaling dead simple
▸ KEDA - pull model vs. Knative - push model
▸ KEDA - Standard Kubernetes resources vs. Knative Service
▸ KEDA can autoscale Knative Eventing Infrastructure
▸ knative-sandbox/eventing-autoscaler-keda
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
29
Red Hat is the world’s leading provider of enterprise
open source software solutions. Award-winning
support, training, and consulting services make
Red Hat a trusted adviser to the Fortune 500.
Thank you

More Related Content

What's hot

Monitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialMonitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_Tutorial
Tim Vaillancourt
 
Introduction to Kibana
Introduction to KibanaIntroduction to Kibana
Introduction to Kibana
Vineet .
 

What's hot (20)

Kubernetes
KubernetesKubernetes
Kubernetes
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
 
Kubernetes dealing with storage and persistence
Kubernetes  dealing with storage and persistenceKubernetes  dealing with storage and persistence
Kubernetes dealing with storage and persistence
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
OCI Overview
OCI OverviewOCI Overview
OCI Overview
 
Event driven autoscaling with KEDA
Event driven autoscaling with KEDAEvent driven autoscaling with KEDA
Event driven autoscaling with KEDA
 
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & DeployOPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container Platform
 
Monitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialMonitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_Tutorial
 
An Introduction to OpenStack
An Introduction to OpenStackAn Introduction to OpenStack
An Introduction to OpenStack
 
Apache Spark on Kubernetes Anirudh Ramanathan and Tim Chen
Apache Spark on Kubernetes Anirudh Ramanathan and Tim ChenApache Spark on Kubernetes Anirudh Ramanathan and Tim Chen
Apache Spark on Kubernetes Anirudh Ramanathan and Tim Chen
 
Google Cloud Composer
Google Cloud ComposerGoogle Cloud Composer
Google Cloud Composer
 
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
Squirreling Away $640 Billion: How Stripe Leverages Flink for Change Data Cap...
 
How Uber scaled its Real Time Infrastructure to Trillion events per day
How Uber scaled its Real Time Infrastructure to Trillion events per dayHow Uber scaled its Real Time Infrastructure to Trillion events per day
How Uber scaled its Real Time Infrastructure to Trillion events per day
 
Introduction to Kibana
Introduction to KibanaIntroduction to Kibana
Introduction to Kibana
 
Tame the small files problem and optimize data layout for streaming ingestion...
Tame the small files problem and optimize data layout for streaming ingestion...Tame the small files problem and optimize data layout for streaming ingestion...
Tame the small files problem and optimize data layout for streaming ingestion...
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep Dive
 

Similar to Event-driven autoscaling through KEDA and Knative Integration | DevNation Tech Talk

Similar to Event-driven autoscaling through KEDA and Knative Integration | DevNation Tech Talk (20)

Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for KubernetesConfluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
 
Cncf event driven autoscaling with keda
Cncf   event driven autoscaling with kedaCncf   event driven autoscaling with keda
Cncf event driven autoscaling with keda
 
Event driven autoscaling with keda
Event driven autoscaling with kedaEvent driven autoscaling with keda
Event driven autoscaling with keda
 
Developing Serverless Applications on Kubernetes with Knative - OSCON 2019
Developing Serverless Applications on Kubernetes with Knative - OSCON 2019Developing Serverless Applications on Kubernetes with Knative - OSCON 2019
Developing Serverless Applications on Kubernetes with Knative - OSCON 2019
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
 
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
 
LINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native WorldLINE's Private Cloud - Meet Cloud Native World
LINE's Private Cloud - Meet Cloud Native World
 
FestiveTechCalendar2022 - Getting Started with Azure Container Apps.pdf
FestiveTechCalendar2022 - Getting Started with Azure Container Apps.pdfFestiveTechCalendar2022 - Getting Started with Azure Container Apps.pdf
FestiveTechCalendar2022 - Getting Started with Azure Container Apps.pdf
 
Cloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
Cloud Native Islamabad - Getting Closer to Continuous Delivery with KnativeCloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
Cloud Native Islamabad - Getting Closer to Continuous Delivery with Knative
 
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on KubernetesDeploying Anything as a Service (XaaS) Using Operators on Kubernetes
Deploying Anything as a Service (XaaS) Using Operators on Kubernetes
 
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
 
KEDA.pdf
KEDA.pdfKEDA.pdf
KEDA.pdf
 
Making Service Deployments to AWS a breeze with Nova
Making Service Deployments to AWS a breeze with NovaMaking Service Deployments to AWS a breeze with Nova
Making Service Deployments to AWS a breeze with Nova
 
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and KubelessBuilding Cloud-Native Applications with Kubernetes, Helm and Kubeless
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
The App Developer's Kubernetes Toolbox
The App Developer's Kubernetes ToolboxThe App Developer's Kubernetes Toolbox
The App Developer's Kubernetes Toolbox
 

More from Red Hat Developers

Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Red Hat Developers
 

More from Red Hat Developers (20)

DevNation Tech Talk: Getting GitOps
DevNation Tech Talk: Getting GitOpsDevNation Tech Talk: Getting GitOps
DevNation Tech Talk: Getting GitOps
 
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesExploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on Kubernetes
 
GitHub Makeover | DevNation Tech Talk
GitHub Makeover | DevNation Tech TalkGitHub Makeover | DevNation Tech Talk
GitHub Makeover | DevNation Tech Talk
 
Quinoa: A modern Quarkus UI with no hassles | DevNation tech Talk
Quinoa: A modern Quarkus UI with no hassles | DevNation tech TalkQuinoa: A modern Quarkus UI with no hassles | DevNation tech Talk
Quinoa: A modern Quarkus UI with no hassles | DevNation tech Talk
 
Extra micrometer practices with Quarkus | DevNation Tech Talk
Extra micrometer practices with Quarkus | DevNation Tech TalkExtra micrometer practices with Quarkus | DevNation Tech Talk
Extra micrometer practices with Quarkus | DevNation Tech Talk
 
Integrating Loom in Quarkus | DevNation Tech Talk
Integrating Loom in Quarkus | DevNation Tech TalkIntegrating Loom in Quarkus | DevNation Tech Talk
Integrating Loom in Quarkus | DevNation Tech Talk
 
Quarkus Renarde 🦊♥: an old-school Web framework with today's touch | DevNatio...
Quarkus Renarde 🦊♥: an old-school Web framework with today's touch | DevNatio...Quarkus Renarde 🦊♥: an old-school Web framework with today's touch | DevNatio...
Quarkus Renarde 🦊♥: an old-school Web framework with today's touch | DevNatio...
 
Containers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkContainers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech Talk
 
Distributed deployment of microservices across multiple OpenShift clusters | ...
Distributed deployment of microservices across multiple OpenShift clusters | ...Distributed deployment of microservices across multiple OpenShift clusters | ...
Distributed deployment of microservices across multiple OpenShift clusters | ...
 
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
 
Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...
Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...
Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...
 
11 CLI tools every developer should know | DevNation Tech Talk
11 CLI tools every developer should know | DevNation Tech Talk11 CLI tools every developer should know | DevNation Tech Talk
11 CLI tools every developer should know | DevNation Tech Talk
 
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech TalkA Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
 
GitHub Actions and OpenShift: ​​Supercharging your software development loops...
GitHub Actions and OpenShift: ​​Supercharging your software development loops...GitHub Actions and OpenShift: ​​Supercharging your software development loops...
GitHub Actions and OpenShift: ​​Supercharging your software development loops...
 
To the moon and beyond with Java 17 APIs! | DevNation Tech Talk
To the moon and beyond with Java 17 APIs! | DevNation Tech TalkTo the moon and beyond with Java 17 APIs! | DevNation Tech Talk
To the moon and beyond with Java 17 APIs! | DevNation Tech Talk
 
Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...
Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...
Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...
 
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
 
Kubernetes configuration and security policies with KubeLinter | DevNation Te...
Kubernetes configuration and security policies with KubeLinter | DevNation Te...Kubernetes configuration and security policies with KubeLinter | DevNation Te...
Kubernetes configuration and security policies with KubeLinter | DevNation Te...
 
Level-up your gaming telemetry using Kafka Streams | DevNation Tech Talk
Level-up your gaming telemetry using Kafka Streams | DevNation Tech TalkLevel-up your gaming telemetry using Kafka Streams | DevNation Tech Talk
Level-up your gaming telemetry using Kafka Streams | DevNation Tech Talk
 
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 

Event-driven autoscaling through KEDA and Knative Integration | DevNation Tech Talk

  • 1. Event-driven Autoscaling through KEDA and Knative Integration Daniel Oh Senior Principal Developer Advocate
  • 2. 2 About Me Daniel Oh ● Senior Principal Technical Marketing Manager at Red Hat ○ Cloud Native Runtimes ○ Serverless and Service Mesh practices ● Ambassador for CNCF and DevOps Institute ● Advisory Board Member of Global Skill Development Council ● Opensource.com Correspondents ● Public Speaker & Developer Advocate ● Published Author ○ Practical Ansible 2 ○ Quarkus for Spring Developers danieloh30 @danieloh30 bit.ly/danielohtv
  • 4. 4 Autoscaling Architecture on Kubernetes w/ External Services
  • 5. 5
  • 6. 6
  • 7. 7 ● Project aims to make Kubernetes Event Driven Autoscaling dead simple ● Started as a partnership between Red Hat and Microsoft (Feb 2019) ● Donated into CNCF as a Sandbox project (Mar 2020) ● KEDA 2.0 brought major redesign (Nov 2020) ● Promoting to CNCF Incubation project (Aug 2021) ● KEDA 2.6 has been released recently (Feb 2022) ● https://keda.sh
  • 8. 8 ● Automatically scale Kubernetes Deployments, Jobs & Custom Resources ● Provides 49+ built-in scalers, but users can build own external scalers ○ Kafka, Prometheus, RabbitMQ, AWS services, Azure Services,... ● Scale resources based on events in the target scalers, eg. messages in Kafka topic ● KEDA does not manipulate the data, just scales the workload ● Installation through OLM Operator or Helm https://keda.sh/docs/2.6/scalers/
  • 9. 9
  • 10. 10 How does KEDA works? ● KEDA is built on top of Kubernetes ● Use ScaledObject/ScaledJob to define scaling metadata ● Manages workloads to scale to 0 ● Registers itself as k8s Metric Adapter ● Provides metrics for Horizontal Pod Autoscaler (HPA) to scale on
  • 11. 11 ScaledObject apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: name: example-so spec: scaleTargetRef: name: example-deployment minReplicaCount: 0 maxReplicaCount: 100 triggers: - type: kafka metadata: bootstrapServers: kafka.svc:9092 consumerGroup: my-group topic: test-topic lagThreshold: '5' ● Can target Deployment, StatefulSet or Custom Resource with scale ● Multiple scalers can be defined as triggers for the target workload ● User can specify HPA related settings to tweak the scaling behavior
  • 13. 13
  • 14. 14 ● Operates on standard k8s resources ● Can scale existing deployed apps ● Pull based approach ● Doesn’t manage data delivery ● K8s Horizontal Pod Autoscaler (HPA) ● Focus is on event driven autoscaling ● Operates on Knative Service ● Existing apps must be converted ● Push based approach ● Manages data delivery (Eventing) ● Knative Autoscaler ● Demand-based autoscaling (HTTP)
  • 15. 15 Use Case #1 Application consuming messages from Kafka topic ● Application is deployed as standard Kubernetes Deployment ● Can be autoscaled only via standard k8s HPA: CPU & Memory ● No event-driven autoscaling Kubernetes Deployment Application Consumes messages
  • 16. #Demo
  • 17. 17 ● Application remains the same and is being deployed the same way ● Event-driven autoscaling enabled through KEDA Scales Kubernetes Deployment Application Consumes messages Scrapes metrics Kubernetes Deployment Application Kubernetes Deployment Application Use Case #2 Redesigned to utilize KEDA
  • 18. #Demo
  • 19. 19 ● Application needs to be rewritten from Kafka consumer to CloudEvents consumer ● Application needs to be redeployed as Knative Service ● Needs Knative Eventing Kafka Source ● Event-driven autoscaling enabled through Knative Autoscaler Consumes messages Knative Eventing Kafka Source Knative Service Application Sends CloudEvents Monitors load & scales Knative Service Application Knative Service Application Use Case #3 Redesigned to utilize Knative
  • 20. #Demo
  • 23. 23 ● KEDA can be used to autoscale Knative Eventing Infrastructure ○ Knative Eventing Sources, Channels ○ Autoscaling allows infrastructure to handle higher loads or save resources (by scaling to 0) when idle ● KEDA could be potentially used to scale Knative Service, in case users don’t want to utilize Knative Eventing for event driven workloads (currently not implemented) KEDA and Knative Integration
  • 24. 24 ● Application deployed as Knative Service and autoscaled by Knative ● Knative Eventing Infrastructure - Kafka Source is autoscaled by KEDA Consumes messages Knative Eventing Kafka Source Knative Service Application Sends CloudEvents Monitors load & scales Knative Service Application Knative Service Application Scrapes metrics Knative Eventing Kafka Source Knative Eventing Kafka Source Scales Use Case #4 Redesigned to utilize Knative and KEDA
  • 25. #Demo
  • 26. 26 knative-sandbox/eventing-autoscaler-keda metadata: annotations: autoscaling.knative.dev/class: keda.autoscaling.knative.dev autoscaling.knative.dev/minScale: "0" autoscaling.knative.dev/maxScale: "5" keda.autoscaling.knative.dev/pollingInterval: "30" keda.autoscaling.knative.dev/cooldownPeriod: "30" # Kafka Source keda.autoscaling.knative.dev/kafkaLagThreshold: "10" # AWS SQS Source keda.autoscaling.knative.dev/awsSqsQueueLength: "5" # Redis Stream Source keda.autoscaling.knative.dev/redisStreamPendingEntriesCount: "5" ● KafkaSource ● AWS SQS Source ● Redis Stream Source ● RabbitMQ Broker https://github.com/knative-sandbox/eventing-autoscaler-keda
  • 28. Takeaways 28 ▸ KEDA - Kubernetes event driven autoscaling dead simple ▸ KEDA - pull model vs. Knative - push model ▸ KEDA - Standard Kubernetes resources vs. Knative Service ▸ KEDA can autoscale Knative Eventing Infrastructure ▸ knative-sandbox/eventing-autoscaler-keda
  • 29. linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 29 Red Hat is the world’s leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you