Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Autoscaling containers with Event Driven workloads

Autoscaling containers with Event Driven workloads

Slides from the session conducted for Azure Developer Community on 29th January 2022 (https://reskilll.com/event/autoscalecontainers). The live dem showcased capabilities of Kubernetes-based Event Driven Autoscaling (KEDA) project to scale .net core containers based on messages in the RabbitMQ.


Nilesh Gule

January 29, 2022

More Decks by Nilesh Gule

Other Decks in Technology


  1. Autoscaling containers with Event Driven workloads

  2. $whoami { “name” : “Nilesh Gule”, “website” : “https://www.HandsOnArchitect.com", “github”

    : “https://GitHub.com/NileshGule" “twitter” : “@nileshgule”, “linkedin” : “https://www.linkedin.com/in/nileshgule”, “likes” : “Technical Evangelism, Cricket”, “co-organizer” : “Azure Singapore UG” } https://bit.ly/AzureSingaporeSessions
  3. None
  4. AGENDA ▸ Scaling options with Kubernetes ▸ KEDA overview ▸

    TechTalks demo with RabbitMQ ▸ Autoscaling with KEDA ▸ KEDA Architecture 4
  5. @nileshgule Pre-requisites Self contained application with all its dependencies Docker

    Dockerhub / private container registry Repository for storing container images Container Registry Orchestrates containers Self healing Service discovery Scaling Kubernetes 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. @nileshgule Kubernetes Scaling Options Horizontal Pod Autoscaler (HPA) Cluster Autoscaler

    Manual scaling
  7. TechTalks Demo 7

  8. @nileshgule TechTalks Producer setup https://github.com/NileshGule/pd-tech-fest-2019  Techtalks producer .Net Core

    API  2 replicas  Exposed as Kubernetes service using LoadBalancer
  9. @nileshgule TechTalks Consumer setup https://github.com/NileshGule/pd-tech-fest-2019  Techtalks consumer .Net Core

    exe  Not exposed outside Kubernetes cluster  Consumes configured number of messages in a batch
  10. @nileshgule RabbitMQ setup https://github.com/NileshGule/pd-tech-fest-2019  RabbitMQ deployed using Helm chart

     Exposed as Kubernetes service
  11. @nileshgule TechTalks Demo setup 1000 (configurable) messages Batch of 50

    (configurable) messages https://github.com/NileshGule/pd-tech-fest-2019 rabbitmq-producer rabbitmq-consumers
  12. @nileshgule TechTalks Demo – Kubernetes deployment https://github.com/NileshGule/pd-tech-fest-2019  Manifest files

    describe Deployment and Service  Helm charts to deploy third-party apps / services  Octant / Lens – visualize k8s cluster  Kubectl to deploy Manifest  Postman to generate workload rabbitmq-producer rabbitmq-consumer
  13. Autoscaling Demo 14

  14. @nileshgule

  15. @nileshgule

  16. @nileshgule

  17. @nileshgule How KEDA works? KEDA moves from the CNCF Sandbox

    to become an incubating project | Cloud Native Computing Foundation
  18. @nileshgule apiVersion: keda.k8s.io/v1alpha1 kind: ScaledObject metadata: name: rabbitmq-consumer-scaled-object namespace: default

    labels: deploymentName: rabbitmq-consumer-deployment spec: scaleTargetRef: deploymentName: rabbitmq-consumer pollingInterval: 5 # Optional. Default: 30 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
  19. @nileshgule KEDA ScaledObject https://github.com/NileshGule/pd-tech-fest-2019

  20. @nileshgule

  21. Azure Blob Storage Azure Event Hub Azure Log Analytics Azure

    Service Bus Queues and Topics Azure Storage Queues ActiveMQ Artemis Kafka Prometheus RabbitMQ Redis Streams Redis Lists Liiklus NATS Huawei Cloudeye AWS CloudWatch AWS Kinesis Stream AWS Simple Queue Service GCP PubSub MSSQL MySQL PostgreSQL Cassandra MongoDB Azure functions https://keda.sh/docs/2.5/scalers/
  22. Summary Single purpose lightweight component Any Kubernetes cluster (1.16+) Extends

    Kubernetes with event driven capabilities No overwriting or duplication of existing functionalities Maps an event source to Deployment, StatefulSet, Custom Resource or Job for scaling Flexible and safe to run alongside any other Kubernetes framework or application Support 45+ auto scalers out of the box 23
  23. @nileshgule KEDA alternatives Knative OpenFaaS Apache OpenWhisk

  24. @nileshgule Play with Docker Play with Kubernetes Linux Academy learning

  25. @nileshgule KEDA AKS cluster-autoscalar Horizontal pod autoscale Knative docs OpenFaaS

    Apache OpenWhisk https://azure.microsoft.com/mediahandler/files/resourcefiles/kubernetes-learning- path/Kubernetes%20Learning%20Path%20version%201.0.pdf
  26. Azure Kubernetes Service Workshop References

  27. References https://bit.ly/youtube-nileshgule

  28. Source Code & slide deck Tech Talks • https://github.com/NileshGule/pd-tech-fest-2019 •

    Azure Developer Community demo setup https://speakerdeck.com/nileshgule/ https://www.slideshare.net/nileshgule/
  29. Nilesh Gule ARCHITECT | MICROSOFT MVP “Code with Passion and

    Strive for Excellence” nileshgule @nileshgule Nilesh Gule NileshGule www.handsonarchitect.com https://bit.ly/youtube-nileshgule
  30. Q&A