SlideShare a Scribd company logo
CollabDays 2020 Barcelona - Serverless Kubernetes with KEDA
KUBERNETES WITH KEDA &
AZURE FUNCTIONS
A WAY TO HAVE SERVERLESS ON KUBERNETES
EDUARD TOMÀS
@EIXIMENIS
#netcoreconf
¿Quien soy yo?
• Principal Tech Lead @ PlainConcepts BCN
• Padre orgulloso
• Bebedor de cerveza
• Picateclas a mucha honra
• Microsoft MVP desde 2012
INDEX
• How can I run Azure Functions on Kubernetes?
• What is KEDA
• Why KEDA
• Some examples
WHY SERVERLESS ON KUBERNETES?
1. Easier adoption of hybrid / multicloud
2. Less lock-in
3. Single platform to focus on
4. Unified operations with other workloads
5. More h/w control (i.e. GPU enabled clusters)
6. Run AFs alongside other app (access to service mesh,
custom shared environment, …)
SERVERLESS VS KUBERNETES
• Not a fight really
• You can run serverless workloads on Kubernetes
• Also there are some serverless kubernetes implementations (AKS virtual nodes, EKS Fargate)
• So, you can have
• Serverless on Kubernetes
• A serverless Kubernetes
• And serverless on a serverless Kubernetes 
THE FUTURE OF K8S IS SERVERLESS
• Serverless containers infrastructure is developed (ACI,
Fargate,…)
• Needs to be orchestrated in some way
• Kubernetes orchestration API is current de-facto
standard
• In near future we will see a mix of nodes and serverless
infrastructure orchestrated under the k8s API
• Kubernetes community is aware of this and API it’s
evolving to support these scenarios
https://thenewstack.io/the-future-of-kubernetes-is-serverless/
CAN I RUN AZURE FUNCTIONS IN KUBERNETES?
• If you can dockerize them, you can run them in
Kubernetes.
• func init --docker-only
• Let’s see it 
DEPLOYING ON KUBERNETES
• You only need a deployment to run the Azure Function
• A secret map to store the secrets (connection strings)
• And your AF it’s up and running! :)
• Again: Let’s see it 
So, running Azure Functions on Kubernetes is not
really the issue…
The really issue is… scaling them appropiately
KUBERNETES (POD) AUTOSCALING 101
To auto scale a deployment you need two things:
1. A metric on which to scale (like %CPU)
2. An HPA bounded to that metric
KUBERNETES (POD) AUTOSCALING 101
• HPA pulls metrics exposed by the metrics server
• OOB metrics server exposes only CPU & Mem
• So, OOB you can auto scale an Azure Function
based on CPU usage or memory consumption
AUTOSCALING AZURE FUNCTIONS
• Usually using CPU or Mem to scale an AF is not the best
strategy
• You are focusing on symptoms rather than causes
• You should scale based on these causes
• pending messages to read
• pending registers to process
• ….
So, KEDA is not about running Azure Functions on
Kubernetes
KEDA is about scaling them
Kubernetes Event Driven Autoscaler
WHAT EXACTLY DOES KEDA?
• KEDA is able to read external metrics…
• … exposing them to the metrics server…
• … allowing the usage of HPA to scale over those
metrics.
WHAT EXACTLY DOES KEDA?
• KEDA do not auto scale your Azure Functions
• But provides all necessary stuff needed by the HPA to
auto scale them based on external metrics.
• Using KEDA you can auto scale your AFs based on the
real causes, not on the symptoms
HOW KEDA DOES ITS JOB?
A scaler watches for
external triggers (like
new message in a
specific queue)
HOW KEDA DOES ITS JOB?
The trigger updates a
metric which is exposed
through the metrics
server.
HOW KEDA DOES ITS JOB?
A standard HPA bound
to this metric scales the
AF deployment if
needed
THE KEDA SCALERS
• Currently KEDA provides several scalers for different
technologies
• More scalers are added over time
• https://keda.sh/docs/2.0/scalers/
THE SCALEDOBJECT CRD
• To “plug” a scaler to the Kubernetes we use the
ScaledObject CRD provided by KEDA
• Each ScaledObject configures one scaler to look for
external events
AUTO SCALING USING KEDA
• So, I have an AF deployed to Kubernetes that I want to auto scale
• I need to create an ScaledObject to get the metric on which to
scale (like pending messages on a SQS queue)
• Then I need to create an HPA bounded to this metric
• And the magic will happen!
• Let’s see it!
SCALING JOBS
• Scaling jobs is an alternative approach to run FaaS-like
workloads
• Instead of processing N events in a single pod, a new job
(which ends creating a pod) is scheduled for each event
• Once again… Let’s see it! 
HPA COULD BE THE MOST POWERFUL VILLAIN
• Beware with workloads scaled
through the HPA
• If scale down is triggered HPA
will just… snap its fingers
• A pod can be killed while
processing!
DEFENDING PODS FROM HPA
1. Using pod lifecycles
1. Ask for “additional” time when Kubernetes wants to
kill the pod.
2. Works but is… ugly (pod could stand in terminating
long time)
2. Using jobs 
THANKS 
HAVE A WONDERFUL DAY AND STAY SAFE!!!
EDUARD TOMÀS
@EIXIMENIS

More Related Content

PPTX
Serverless Reality
PPTX
AKS Azure Kubernetes Services Workshop Jorge Arteiro
PPT
Sebastien goasguen cloud stack and docker
PPT
Sebastien goasguen cloud stack the next year
PDF
Matt Chung (Independent) - Serverless application with AWS Lambda
PDF
Netflix Cloud Platform and Open Source
PDF
Crafting Kubernetes Operators
PPTX
Meetup gitlab intro in seoul
Serverless Reality
AKS Azure Kubernetes Services Workshop Jorge Arteiro
Sebastien goasguen cloud stack and docker
Sebastien goasguen cloud stack the next year
Matt Chung (Independent) - Serverless application with AWS Lambda
Netflix Cloud Platform and Open Source
Crafting Kubernetes Operators
Meetup gitlab intro in seoul

What's hot (20)

PDF
Who needs containers in a serverless world
PPTX
Serverless
PPTX
Open service broker API with Azure Kubernetes Services
PDF
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
PPTX
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY
PPTX
End-to-end test automation with Endtest.dev
PPTX
Why kubernetes
PPTX
AKS - Azure Kubernetes Services - kubernetes meetup may 2018
PDF
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned
PDF
Microservices architecture pitfalls
PDF
TechTalk - Building Serverless Applications with IBM Bluemix
PDF
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
PDF
Webinar kubernetes and-spark
PPTX
Azure AKS
PPTX
Azure kubernetes service
PDF
Run the elastic stack on kubernetes with eck
PDF
Creating a Kubernetes Operator in Java
PDF
Managing add-ons across clusters
PDF
Manage thousands of k8s applications with minimal efforts using kube carrier
PPTX
Going Serverless with Kubeless In Google Container Engine (GKE)
Who needs containers in a serverless world
Serverless
Open service broker API with Azure Kubernetes Services
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY
End-to-end test automation with Endtest.dev
Why kubernetes
AKS - Azure Kubernetes Services - kubernetes meetup may 2018
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned
Microservices architecture pitfalls
TechTalk - Building Serverless Applications with IBM Bluemix
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Webinar kubernetes and-spark
Azure AKS
Azure kubernetes service
Run the elastic stack on kubernetes with eck
Creating a Kubernetes Operator in Java
Managing add-ons across clusters
Manage thousands of k8s applications with minimal efforts using kube carrier
Going Serverless with Kubeless In Google Container Engine (GKE)
Ad

Similar to CollabDays 2020 Barcelona - Serverless Kubernetes with KEDA (20)

PPTX
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
PPTX
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
PPTX
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
PPTX
KEDA Sacle to Zero - Serverless Meetup Nov 2024.pptx
PPTX
Global Azure Virtual - Application Autoscaling with KEDA
PPTX
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
PDF
KEDA.pdf
PDF
Cncf event driven autoscaling with keda
PDF
Event driven autoscaling with keda
PDF
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
PPTX
Kubernetes fundamentals
PPTX
Nodeless and serverless kubernetes
PDF
Kubernetes: Learning from Zero to Production
PPTX
Autoscaling in Kubernetes
PDF
Scale your (aks) cluster, luke!
PPTX
Kubernetes101 - Pune Kubernetes Meetup 6
PDF
Event driven autoscaling with KEDA
PDF
Autoscaling containers with event driven workloads
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PPTX
Autoscaling with Kubernetes
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
KEDA Sacle to Zero - Serverless Meetup Nov 2024.pptx
Global Azure Virtual - Application Autoscaling with KEDA
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
KEDA.pdf
Cncf event driven autoscaling with keda
Event driven autoscaling with keda
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
Kubernetes fundamentals
Nodeless and serverless kubernetes
Kubernetes: Learning from Zero to Production
Autoscaling in Kubernetes
Scale your (aks) cluster, luke!
Kubernetes101 - Pune Kubernetes Meetup 6
Event driven autoscaling with KEDA
Autoscaling containers with event driven workloads
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
Autoscaling with Kubernetes
Ad

More from Eduard Tomàs (20)

PPTX
Kubernetes: Do's, don'ts and why's
PPTX
KCDS 2021- Escalando workloads serverless en Kubernetes con KEDA
PPTX
Escalando workloads serverless en Kubernetes con Keda
PPTX
C#9 - Más C# que nunca
PPTX
Keda o como convertir Kubernetess en Serverless
PPTX
.NET Memoria y Rendimiento
PPTX
Containers en .NET (Dot Net 2018 - Spain)
PPTX
Esos contenedores, ¡a producción! (Commit Conf 2018)
PPTX
Codemotion 2015 - Bienvenido de nuevo c++
PPTX
El "peor" lenguaje del mundo
PPTX
Containerize a netcore application with aks
PPTX
Escenarios avanzados en AKS (Global Azure Bootcamp Barcelona 2019)
PPTX
Aplicaciones de consola fáciles? Más quisieramos
PPTX
Serverless with Azure Functions and CosmosDb
PPTX
Docker y todo eso... más o menos
PPTX
Microservices: Yes or not?
PPTX
ASP.NET MVC Core
PPTX
Azure functions
PPTX
React native - Unleash the power of your device
PPTX
JavaScript in 2016 (Codemotion Rome)
Kubernetes: Do's, don'ts and why's
KCDS 2021- Escalando workloads serverless en Kubernetes con KEDA
Escalando workloads serverless en Kubernetes con Keda
C#9 - Más C# que nunca
Keda o como convertir Kubernetess en Serverless
.NET Memoria y Rendimiento
Containers en .NET (Dot Net 2018 - Spain)
Esos contenedores, ¡a producción! (Commit Conf 2018)
Codemotion 2015 - Bienvenido de nuevo c++
El "peor" lenguaje del mundo
Containerize a netcore application with aks
Escenarios avanzados en AKS (Global Azure Bootcamp Barcelona 2019)
Aplicaciones de consola fáciles? Más quisieramos
Serverless with Azure Functions and CosmosDb
Docker y todo eso... más o menos
Microservices: Yes or not?
ASP.NET MVC Core
Azure functions
React native - Unleash the power of your device
JavaScript in 2016 (Codemotion Rome)

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
medical staffing services at VALiNTRY
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Digital Strategies for Manufacturing Companies
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPT
Introduction Database Management System for Course Database
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Odoo POS Development Services by CandidRoot Solutions
PTS Company Brochure 2025 (1).pdf.......
medical staffing services at VALiNTRY
Understanding Forklifts - TECH EHS Solution
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Online Work Permit System for Fast Permit Processing
Digital Strategies for Manufacturing Companies
Nekopoi APK 2025 free lastest update
How to Choose the Right IT Partner for Your Business in Malaysia
How Creative Agencies Leverage Project Management Software.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Introduction Database Management System for Course Database
ISO 45001 Occupational Health and Safety Management System
Wondershare Filmora 15 Crack With Activation Key [2025
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Odoo POS Development Services by CandidRoot Solutions

CollabDays 2020 Barcelona - Serverless Kubernetes with KEDA

  • 2. KUBERNETES WITH KEDA & AZURE FUNCTIONS A WAY TO HAVE SERVERLESS ON KUBERNETES EDUARD TOMÀS @EIXIMENIS
  • 3. #netcoreconf ¿Quien soy yo? • Principal Tech Lead @ PlainConcepts BCN • Padre orgulloso • Bebedor de cerveza • Picateclas a mucha honra • Microsoft MVP desde 2012
  • 4. INDEX • How can I run Azure Functions on Kubernetes? • What is KEDA • Why KEDA • Some examples
  • 5. WHY SERVERLESS ON KUBERNETES? 1. Easier adoption of hybrid / multicloud 2. Less lock-in 3. Single platform to focus on 4. Unified operations with other workloads 5. More h/w control (i.e. GPU enabled clusters) 6. Run AFs alongside other app (access to service mesh, custom shared environment, …)
  • 6. SERVERLESS VS KUBERNETES • Not a fight really • You can run serverless workloads on Kubernetes • Also there are some serverless kubernetes implementations (AKS virtual nodes, EKS Fargate) • So, you can have • Serverless on Kubernetes • A serverless Kubernetes • And serverless on a serverless Kubernetes 
  • 7. THE FUTURE OF K8S IS SERVERLESS • Serverless containers infrastructure is developed (ACI, Fargate,…) • Needs to be orchestrated in some way • Kubernetes orchestration API is current de-facto standard • In near future we will see a mix of nodes and serverless infrastructure orchestrated under the k8s API • Kubernetes community is aware of this and API it’s evolving to support these scenarios https://thenewstack.io/the-future-of-kubernetes-is-serverless/
  • 8. CAN I RUN AZURE FUNCTIONS IN KUBERNETES? • If you can dockerize them, you can run them in Kubernetes. • func init --docker-only • Let’s see it 
  • 9. DEPLOYING ON KUBERNETES • You only need a deployment to run the Azure Function • A secret map to store the secrets (connection strings) • And your AF it’s up and running! :) • Again: Let’s see it 
  • 10. So, running Azure Functions on Kubernetes is not really the issue… The really issue is… scaling them appropiately
  • 11. KUBERNETES (POD) AUTOSCALING 101 To auto scale a deployment you need two things: 1. A metric on which to scale (like %CPU) 2. An HPA bounded to that metric
  • 12. KUBERNETES (POD) AUTOSCALING 101 • HPA pulls metrics exposed by the metrics server • OOB metrics server exposes only CPU & Mem • So, OOB you can auto scale an Azure Function based on CPU usage or memory consumption
  • 13. AUTOSCALING AZURE FUNCTIONS • Usually using CPU or Mem to scale an AF is not the best strategy • You are focusing on symptoms rather than causes • You should scale based on these causes • pending messages to read • pending registers to process • ….
  • 14. So, KEDA is not about running Azure Functions on Kubernetes KEDA is about scaling them Kubernetes Event Driven Autoscaler
  • 15. WHAT EXACTLY DOES KEDA? • KEDA is able to read external metrics… • … exposing them to the metrics server… • … allowing the usage of HPA to scale over those metrics.
  • 16. WHAT EXACTLY DOES KEDA? • KEDA do not auto scale your Azure Functions • But provides all necessary stuff needed by the HPA to auto scale them based on external metrics. • Using KEDA you can auto scale your AFs based on the real causes, not on the symptoms
  • 17. HOW KEDA DOES ITS JOB? A scaler watches for external triggers (like new message in a specific queue)
  • 18. HOW KEDA DOES ITS JOB? The trigger updates a metric which is exposed through the metrics server.
  • 19. HOW KEDA DOES ITS JOB? A standard HPA bound to this metric scales the AF deployment if needed
  • 20. THE KEDA SCALERS • Currently KEDA provides several scalers for different technologies • More scalers are added over time • https://keda.sh/docs/2.0/scalers/
  • 21. THE SCALEDOBJECT CRD • To “plug” a scaler to the Kubernetes we use the ScaledObject CRD provided by KEDA • Each ScaledObject configures one scaler to look for external events
  • 22. AUTO SCALING USING KEDA • So, I have an AF deployed to Kubernetes that I want to auto scale • I need to create an ScaledObject to get the metric on which to scale (like pending messages on a SQS queue) • Then I need to create an HPA bounded to this metric • And the magic will happen! • Let’s see it!
  • 23. SCALING JOBS • Scaling jobs is an alternative approach to run FaaS-like workloads • Instead of processing N events in a single pod, a new job (which ends creating a pod) is scheduled for each event • Once again… Let’s see it! 
  • 24. HPA COULD BE THE MOST POWERFUL VILLAIN • Beware with workloads scaled through the HPA • If scale down is triggered HPA will just… snap its fingers • A pod can be killed while processing!
  • 25. DEFENDING PODS FROM HPA 1. Using pod lifecycles 1. Ask for “additional” time when Kubernetes wants to kill the pod. 2. Works but is… ugly (pod could stand in terminating long time) 2. Using jobs 
  • 26. THANKS  HAVE A WONDERFUL DAY AND STAY SAFE!!! EDUARD TOMÀS @EIXIMENIS