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

What's hot (20)

PDF
Who needs containers in a serverless world
Matthias Luebken
 
PPTX
Serverless
Vishwas N
 
PPTX
Open service broker API with Azure Kubernetes Services
Jorge Arteiro
 
PDF
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
CodeOps Technologies LLP
 
PPTX
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY
Red Hat Developers
 
PPTX
End-to-end test automation with Endtest.dev
Konstantin Tarkus
 
PPTX
Why kubernetes
Jorge Arteiro
 
PPTX
AKS - Azure Kubernetes Services - kubernetes meetup may 2018
Jorge Arteiro
 
PDF
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned
Kacper Gunia
 
PDF
Microservices architecture pitfalls
allegro.tech
 
PDF
TechTalk - Building Serverless Applications with IBM Bluemix
Janakiram MSV
 
PDF
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Outlyer
 
PDF
Webinar kubernetes and-spark
cnvrg.io AI OS - Hands-on ML Workshops
 
PPTX
Azure AKS
Gaetan Jaminon
 
PPTX
Azure kubernetes service
Vishwas N
 
PDF
Run the elastic stack on kubernetes with eck
Daliya Spasova
 
PDF
Creating a Kubernetes Operator in Java
Rudy De Busscher
 
PDF
Managing add-ons across clusters
LibbySchulze
 
PDF
Manage thousands of k8s applications with minimal efforts using kube carrier
LibbySchulze
 
PPTX
Going Serverless with Kubeless In Google Container Engine (GKE)
Bitnami
 
Who needs containers in a serverless world
Matthias Luebken
 
Serverless
Vishwas N
 
Open service broker API with Azure Kubernetes Services
Jorge Arteiro
 
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
CodeOps Technologies LLP
 
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY
Red Hat Developers
 
End-to-end test automation with Endtest.dev
Konstantin Tarkus
 
Why kubernetes
Jorge Arteiro
 
AKS - Azure Kubernetes Services - kubernetes meetup may 2018
Jorge Arteiro
 
Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned
Kacper Gunia
 
Microservices architecture pitfalls
allegro.tech
 
TechTalk - Building Serverless Applications with IBM Bluemix
Janakiram MSV
 
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Outlyer
 
Webinar kubernetes and-spark
cnvrg.io AI OS - Hands-on ML Workshops
 
Azure AKS
Gaetan Jaminon
 
Azure kubernetes service
Vishwas N
 
Run the elastic stack on kubernetes with eck
Daliya Spasova
 
Creating a Kubernetes Operator in Java
Rudy De Busscher
 
Managing add-ons across clusters
LibbySchulze
 
Manage thousands of k8s applications with minimal efforts using kube carrier
LibbySchulze
 
Going Serverless with Kubeless In Google Container Engine (GKE)
Bitnami
 

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

PPTX
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
Tom Kerkhove
 
PPTX
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Codit
 
PPTX
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Tom Kerkhove
 
PPTX
KEDA Sacle to Zero - Serverless Meetup Nov 2024.pptx
ssuserd4e0d2
 
PPTX
Global Azure Virtual - Application Autoscaling with KEDA
Tom Kerkhove
 
PPTX
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
Tom Kerkhove
 
PDF
KEDA.pdf
Vishwas N
 
PDF
Event driven autoscaling with keda
Adam Hamsik
 
PDF
Cncf event driven autoscaling with keda
JurajHantk
 
PDF
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
Red Hat Developers
 
PPTX
Kubernetes fundamentals
Victor Morales
 
PPTX
Nodeless and serverless kubernetes
Nills Franssens
 
PDF
Kubernetes: Learning from Zero to Production
Rosemary Wang
 
PPTX
Autoscaling in Kubernetes
Hrishikesh Deodhar
 
PDF
Scale your (aks) cluster, luke!
Alessandro Melchiori
 
PPTX
Kubernetes101 - Pune Kubernetes Meetup 6
Harshal Shah
 
PDF
Event driven autoscaling with KEDA
Nilesh Gule
 
PDF
Autoscaling containers with event driven workloads
Nilesh Gule
 
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
PPTX
Autoscaling with Kubernetes
Johannes Würbach
 
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
Tom Kerkhove
 
Application Autoscaling Made Easy with Kubernetes Event-Driven Autoscaling (K...
Codit
 
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Tom Kerkhove
 
KEDA Sacle to Zero - Serverless Meetup Nov 2024.pptx
ssuserd4e0d2
 
Global Azure Virtual - Application Autoscaling with KEDA
Tom Kerkhove
 
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
Tom Kerkhove
 
KEDA.pdf
Vishwas N
 
Event driven autoscaling with keda
Adam Hamsik
 
Cncf event driven autoscaling with keda
JurajHantk
 
Event-driven autoscaling through KEDA and Knative Integration | DevNation Tec...
Red Hat Developers
 
Kubernetes fundamentals
Victor Morales
 
Nodeless and serverless kubernetes
Nills Franssens
 
Kubernetes: Learning from Zero to Production
Rosemary Wang
 
Autoscaling in Kubernetes
Hrishikesh Deodhar
 
Scale your (aks) cluster, luke!
Alessandro Melchiori
 
Kubernetes101 - Pune Kubernetes Meetup 6
Harshal Shah
 
Event driven autoscaling with KEDA
Nilesh Gule
 
Autoscaling containers with event driven workloads
Nilesh Gule
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
Autoscaling with Kubernetes
Johannes Würbach
 
Ad

More from Eduard Tomàs (20)

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

Recently uploaded (20)

PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
Add Background Images to Charts in IBM SPSS Statistics Version 31.pdf
Version 1 Analytics
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Add Background Images to Charts in IBM SPSS Statistics Version 31.pdf
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 

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