Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Scaling containers with AKS and ACI

51 views

Published on

Slide deck from the virtual session for Dear Azure community in India. During the session, we covered the containerizing .net Core application, publish Docker images to private Azure Container Registry (ACR). These containers images are deployed to Azure Kubernetes Service cluster. Using Helm we deploy RabbitMQ and KEDA on the Kubernetes cluster. Finally, we extend the autoscaling to serverless environment with Azure Container Instances (ACI) and virtual node

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Scaling containers with AKS and ACI

  1. 1. Nilesh Gule @nileshgule | www.HandsOnArchitect.com Scaling .Net Core Containers with Azure Kubernetes Service and Serverless ACI
  2. 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” }
  3. 3. @nileshgule Containerize .Net Core App Build & publish Docker images to private Azure Container Registry (ACR) Autoscale using k8s K8s deployment, KEDA autoscaling, extending to serverless Azure Container Instences (ACI) Application Overview Docker Images Container Registries Kubernetes deployment Autoscaling with KEDA Serverless container with ACI Agenda
  4. 4. @nileshgule RabbitMQ Demo – Producer & Consumer 1000 (configurable) messages Batch of 50 (configurable) messages https://github.com/NileshGule/pd-tech-fest-2019
  5. 5. @nileshgule Docker – main features Security Process isolation, resource limits Portability Runs across multiple env with Docker runtime Performance Smaller footprint than VM, lightning fast Multi-cloud Deploy Docker images to multi-cloud environments Isolation Isolates multiple versions of dependencies Agility Integrates into CI CD pipelines
  6. 6. Demo build & publish docker images
  7. 7. @nileshgule RabbitMQ Demo – Docker Images https://github.com/NileshGule/pd-tech-fest-2019  Docker multi-stage builds  Docker-compose, build & publish multiple images  Azure Container Registry (ACR) private registry
  8. 8. @nileshgule RabbitMQ Demo –Docker Container Registry
  9. 9. @nileshgule Kubernetes – main features Self healing Restart / Replace / kill containers based on heath checks Service discovery & LB Expose container using DNS name or IP Secrets & Config Mgt Manage sensitive info (pwd / Oauth tokens / SSH keys etc) Auto bin packing Fits containers to nodes based on resource limits Storage Orchestration Mount storage from local, public cloud oro ther sources Auto rollout & rollback Desired state configuration to manage rollouts & upgrades
  10. 10. @nileshgule
  11. 11. Demo deploy application containers
  12. 12. @nileshgule RabbitMQ 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 – visualize k8s cluster  Kubectl to deploy Manifest
  13. 13. AKS Managed Identity (aksmqcluster-agentpool) nileshgule/techtalksmqproducer nileshgule/techtalksmqconsumer ngACRRegistry aksmqCluster ngacrregistry.azurecr.io/nileshgule /techtalksmqproducer ngacrregistry.azurecr.io/nileshgule/ techtalksmqconsumer Acr pull acrResourceGroup demo-kedaSeriesRG docker push using azure user token Acr login using AAD No need to use Admin user
  14. 14. @nileshgule Kubernetes Scaling Options 1 2 3 Horizontal Pod Autoscaler Cluster Autoscaler Manual scaling
  15. 15. KEDA Architecture
  16. 16. Azure Event Hub Azure Service Bus Queues and Topics Azure Storage Queues Kafka Prometheus RabbitMQ Redis Lists Liiklus NATS AWS CloudWatch AWS Simple Queue Service GCP PubSub Integrates with Azure functions
  17. 17. @nileshgule RabbitMQ Demo – KEDA Event driven autoscaling  RabbitMQ event source  KEDA autoscaler to scale consumer deployment1000 (configurable) messages Batch of 50 (configurable) messages https://github.com/NileshGule/pd-tech-fest-2019
  18. 18. Demo deploy KEDA on AKS cluster
  19. 19. 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
  20. 20. Pros Cons
  21. 21. Scale RabbitMQ Consumer with Virtual Node kedaVNet kedaAKSSubnet kedaVirtualNodeSubnet Producer - .Net Core API Consumers - .Net Core exe
  22. 22. Demo extend KEDA with Virtual Node
  23. 23. Summary • Self contained application with all its dependencies Docker • Orchestrates containers • Self healing • Service discovery • Scaling Kubernetes • Extends Kubernetes with event driven capabilities KEDA
  24. 24. Play with Docker Play with Kubernetes Kubernetes Learning Path : MSLearn Linux Academy learning paths
  25. 25. AKS cluster-autoscalar Virtual Node Horizontal pod autoscale virtual kubelet KEDA https://azure.microsoft.com/mediahandler/files/resourcefiles/kubernetes-learning- path/Kubernetes%20Learning%20Path%20version%201.0.pdf
  26. 26. Azure Kubernetes Service Workshop References
  27. 27. https://github.com/NileshGule/pd-tech-fest-2019
  28. 28. Thank you very much Code with Passion and Strive for Excellence https://www.slideshare.net/nileshgule/presentations https://speakerdeck.com/nileshgule/
  29. 29. Nilesh Gule ARCHITECT | MICROSOFT MVP “Code with Passion and Strive for Excellence” nileshgule @nileshgule Nilesh Gule NileshGule www.handsonarchitect.com
  30. 30. Q&A

×