SlideShare uma empresa Scribd logo
1 de 21
An implementation primer
ContainerConf 2018 Bangalore
Autoscaling in Kubernetes
Hrishikesh Deodhar
Director of Engineering
InfraCloud technologies
www.infracloud.io
https://www.linkedin.com/in/hrishikesh-deodhar
https://twitter.com/Hrishi_kesh_
Containers | DevOps | Cloud | Kubernetes
Auto of Scale
● Autoscaling: Why & what?
● What to scale in Kubernetes
○ Pods
○ Nodes
● Pod scaling
○ Metric Server
○ HPA controller
○ Monitoring pipeline
● Node Scaling
○ Kubernetes Autoscaler
○ Escalator
As explained to a 5 year old
Image Source: http://blog.infracloud.io/kubernetes-autoscaling-explained/
Capacity of
current app
With single
instance
User
Requests
Your current
VM/Pod/Container
A spare instance so that
load can be shared
● Horizontally Scale
○ Applications to meet user demand
○ Nodes to meet infrastructure demand
(Of applications)
Autoscaling: what?
● Match: Actual usage == Current Usage
● Use elasticity of cloud effectively
● Optimize Cost
Autoscaling: why?
Pod Autoscaling
Let’s start with a demo
Horizontal Pod Autoscaler Controller
Deployment Controller
Kubelet
KubeletcAdvisor
Kubelet
Pod Pod Pod
Metrics ServerMetrics Aggregator
Replica set
Resource
Metrics from
Pods
Pod Autoscaling (What just happened earlier...)
Prometheus Adapter
Prometheus
Custom
Metrics
Pod
Node Autoscaling
Node Autoscaling
● Kubernetes AutoScaler
(https://github.com/kubernetes/autoscaler)
● Escalator (https://github.com/atlassian/escalator)
We will talk about Kubernetes Autoscaler
Kubernetes Autoscaler: Basics
● A controller inside Kubernetes Cluster
● Increases Cluster Size when:
○ Pods in pending state due to insufficient resources
● Decreases Cluster Size when:
○ Cluster resource consumption is low for sufficient duration
Kubernetes Autoscaler: Safety first!
Won’t evict nodes if:
● PodDisruptionBudget is restrictive
● Pod can not be moved because of affinity/node selector rules
● Kube-system pods running
● Pods with local storage
● Pods with annotation:
"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"
Clusters can be complicated business!
Availability Zone 1
Availability Zone 3
Availability Zone 2
Node Pool 1 (CPU Intensive)
● Scaling happens
at node pool level
● Can be done
across AZs
● “Expanders” can
be used for
different
strategies
Node Pool 2 (Mem Intensive)
Node Pool 2 (GPU - ML/DL)
HPA & Autoscaler: Marriage made in heaven
Pods & Nodes scale down
After the load goes down, pods are evicted.
This leads to under utilization of nodes and
node is evicted
HPA Scales Pods
HPA scales the pods based on HPA
definitions. More pods are are scheduled
and some of them go in pending state
Autoscaler Kicks in
Cluster autoscaler adds more nodes based on pending pods and pods start running
HPA and cluster
scaling working
together
Recommendations
From a real world implementation
Scaling speed
The delay between two consecutive up/down scale in HPA
is configured at cluster level (Current upscale delay at 3m).
Based on how fast you need to scale, this should be
configured at cluster level.
Similar controls exist for node autoscaler
Scaling metric
Every workload is different, some should be scaled on CPU,
some on number of messages in queue, some on a different
metric outside of application. Choose your “scaling metric”
carefully!
Monitoring Adapters
If you are using a commercial monitoring tool - you will
have to route metrics to metric server. You can also build
not to depend on outage of a SaaS monitoring tool!
Also check you have adapter from monitoring tool to
Metric server!
State & Scaling
Statefulset scaling is very different - you need to provision
volume etc. and depending on underlying datastore, might
need initial data bootstrapping etc
Further reading
● Metrics Server (https://github.com/kubernetes-incubator/metrics-server)
● https://github.com/infracloudio/kubernetes-autoscaling
● https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
● https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md
Thank you!
Demo code:
https://github.com/infracloudio/kubernetes-autoscaling

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
 
An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architecture
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
 
Helm.pptx
Helm.pptxHelm.pptx
Helm.pptx
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
AKS - Azure Kubernetes Services - kubernetes meetup may 2018
AKS - Azure Kubernetes Services  - kubernetes meetup may 2018AKS - Azure Kubernetes Services  - kubernetes meetup may 2018
AKS - Azure Kubernetes Services - kubernetes meetup may 2018
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for Kubernetes
 
AKS
AKSAKS
AKS
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installation
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
 
KubeVirt (Kubernetes and Cloud Native Toronto)
KubeVirt (Kubernetes and Cloud Native Toronto)KubeVirt (Kubernetes and Cloud Native Toronto)
KubeVirt (Kubernetes and Cloud Native Toronto)
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 

Semelhante a Autoscaling in Kubernetes

How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updatedHow kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
Shikha Srivastava
 
Autoscaling Confluent Cloud: Should We? How Would We?
Autoscaling Confluent Cloud: Should We? How Would We?Autoscaling Confluent Cloud: Should We? How Would We?
Autoscaling Confluent Cloud: Should We? How Would We?
HostedbyConfluent
 
WSO2Con Asia 2014 - Essential Elements of an Enterprise PaaS
WSO2Con Asia 2014 - Essential Elements of an Enterprise PaaSWSO2Con Asia 2014 - Essential Elements of an Enterprise PaaS
WSO2Con Asia 2014 - Essential Elements of an Enterprise PaaS
WSO2
 

Semelhante a Autoscaling in Kubernetes (20)

Kubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby StepsKubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby Steps
 
Confluent Tech Talk Korea
Confluent Tech Talk KoreaConfluent Tech Talk Korea
Confluent Tech Talk Korea
 
IBM Cloud Integration Platform High Availability - Integration Tech Conference
IBM Cloud Integration Platform High Availability - Integration Tech ConferenceIBM Cloud Integration Platform High Availability - Integration Tech Conference
IBM Cloud Integration Platform High Availability - Integration Tech Conference
 
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
 
Unit 5.pptx
Unit 5.pptxUnit 5.pptx
Unit 5.pptx
 
Feedback on building Production-Ready Microsoft Teams Apps
Feedback on building Production-Ready Microsoft Teams AppsFeedback on building Production-Ready Microsoft Teams Apps
Feedback on building Production-Ready Microsoft Teams Apps
 
Uber Business Metrics Generation and Management Through Apache Flink
Uber Business Metrics Generation and Management Through Apache FlinkUber Business Metrics Generation and Management Through Apache Flink
Uber Business Metrics Generation and Management Through Apache Flink
 
Session on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log managementSession on API auto scaling, monitoring and Log management
Session on API auto scaling, monitoring and Log management
 
Introducing github.com/open-cluster-management – How to deliver apps across c...
Introducing github.com/open-cluster-management – How to deliver apps across c...Introducing github.com/open-cluster-management – How to deliver apps across c...
Introducing github.com/open-cluster-management – How to deliver apps across c...
 
QCon New York 2014 - Apache Stratos
QCon New York 2014  - Apache StratosQCon New York 2014  - Apache Stratos
QCon New York 2014 - Apache Stratos
 
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob KaralusDistributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services
 
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
 
Kubernetes basics, Nodes, Pods, Containers, Deployments
Kubernetes basics, Nodes, Pods, Containers, DeploymentsKubernetes basics, Nodes, Pods, Containers, Deployments
Kubernetes basics, Nodes, Pods, Containers, Deployments
 
How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updatedHow kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
 
Autoscaling Confluent Cloud: Should We? How Would We?
Autoscaling Confluent Cloud: Should We? How Would We?Autoscaling Confluent Cloud: Should We? How Would We?
Autoscaling Confluent Cloud: Should We? How Would We?
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
 
Azure appservice
Azure appserviceAzure appservice
Azure appservice
 
03-03-2023 - APIForce (1).pdf
03-03-2023 - APIForce (1).pdf03-03-2023 - APIForce (1).pdf
03-03-2023 - APIForce (1).pdf
 
WSO2Con Asia 2014 - Essential Elements of an Enterprise PaaS
WSO2Con Asia 2014 - Essential Elements of an Enterprise PaaSWSO2Con Asia 2014 - Essential Elements of an Enterprise PaaS
WSO2Con Asia 2014 - Essential Elements of an Enterprise PaaS
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Autoscaling in Kubernetes

  • 1. An implementation primer ContainerConf 2018 Bangalore Autoscaling in Kubernetes
  • 2. Hrishikesh Deodhar Director of Engineering InfraCloud technologies www.infracloud.io https://www.linkedin.com/in/hrishikesh-deodhar https://twitter.com/Hrishi_kesh_ Containers | DevOps | Cloud | Kubernetes
  • 3. Auto of Scale ● Autoscaling: Why & what? ● What to scale in Kubernetes ○ Pods ○ Nodes ● Pod scaling ○ Metric Server ○ HPA controller ○ Monitoring pipeline ● Node Scaling ○ Kubernetes Autoscaler ○ Escalator
  • 4. As explained to a 5 year old Image Source: http://blog.infracloud.io/kubernetes-autoscaling-explained/ Capacity of current app With single instance User Requests Your current VM/Pod/Container A spare instance so that load can be shared
  • 5. ● Horizontally Scale ○ Applications to meet user demand ○ Nodes to meet infrastructure demand (Of applications) Autoscaling: what?
  • 6. ● Match: Actual usage == Current Usage ● Use elasticity of cloud effectively ● Optimize Cost Autoscaling: why?
  • 8. Horizontal Pod Autoscaler Controller Deployment Controller Kubelet KubeletcAdvisor Kubelet Pod Pod Pod Metrics ServerMetrics Aggregator Replica set Resource Metrics from Pods Pod Autoscaling (What just happened earlier...) Prometheus Adapter Prometheus Custom Metrics Pod
  • 10. Node Autoscaling ● Kubernetes AutoScaler (https://github.com/kubernetes/autoscaler) ● Escalator (https://github.com/atlassian/escalator) We will talk about Kubernetes Autoscaler
  • 11. Kubernetes Autoscaler: Basics ● A controller inside Kubernetes Cluster ● Increases Cluster Size when: ○ Pods in pending state due to insufficient resources ● Decreases Cluster Size when: ○ Cluster resource consumption is low for sufficient duration
  • 12. Kubernetes Autoscaler: Safety first! Won’t evict nodes if: ● PodDisruptionBudget is restrictive ● Pod can not be moved because of affinity/node selector rules ● Kube-system pods running ● Pods with local storage ● Pods with annotation: "cluster-autoscaler.kubernetes.io/safe-to-evict": "false"
  • 13. Clusters can be complicated business! Availability Zone 1 Availability Zone 3 Availability Zone 2 Node Pool 1 (CPU Intensive) ● Scaling happens at node pool level ● Can be done across AZs ● “Expanders” can be used for different strategies Node Pool 2 (Mem Intensive) Node Pool 2 (GPU - ML/DL)
  • 14. HPA & Autoscaler: Marriage made in heaven Pods & Nodes scale down After the load goes down, pods are evicted. This leads to under utilization of nodes and node is evicted HPA Scales Pods HPA scales the pods based on HPA definitions. More pods are are scheduled and some of them go in pending state Autoscaler Kicks in Cluster autoscaler adds more nodes based on pending pods and pods start running HPA and cluster scaling working together
  • 15. Recommendations From a real world implementation
  • 16. Scaling speed The delay between two consecutive up/down scale in HPA is configured at cluster level (Current upscale delay at 3m). Based on how fast you need to scale, this should be configured at cluster level. Similar controls exist for node autoscaler
  • 17. Scaling metric Every workload is different, some should be scaled on CPU, some on number of messages in queue, some on a different metric outside of application. Choose your “scaling metric” carefully!
  • 18. Monitoring Adapters If you are using a commercial monitoring tool - you will have to route metrics to metric server. You can also build not to depend on outage of a SaaS monitoring tool! Also check you have adapter from monitoring tool to Metric server!
  • 19. State & Scaling Statefulset scaling is very different - you need to provision volume etc. and depending on underlying datastore, might need initial data bootstrapping etc
  • 20. Further reading ● Metrics Server (https://github.com/kubernetes-incubator/metrics-server) ● https://github.com/infracloudio/kubernetes-autoscaling ● https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ ● https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md

Notas do Editor

  1. Autoscaling in kubernetes has 2 dimensions: Pod autoscaling or workload autoscaling and Cluster autoscaling, autoscaling your cluster hosts to provide more compute. Why do you need autoscaling? Well why not? When you setup your kubernetes cluster to run your containerized workloads, the setup typically takes into consideration, the load that is being expected on the cluster, number of users which will utilize the application, what kind of application do you serve and several other factors.
  2. Autoscaling in kubernetes has 2 dimensions: Pod autoscaling or workload autoscaling and Cluster autoscaling, autoscaling your cluster hosts to provide more compute. Why do you need autoscaling? Well why not? When you setup your kubernetes cluster to run your containerized workloads, the setup typically takes into consideration, the load that is being expected on the cluster, number of users which will utilize the application, what kind of application do you serve and several other factors.
  3. Horizontal Pod Autoscaling : It is a kubernetes resource and is implemented as a controller. Control loop can be controlled by the --horizontal-pod-autoscaler-sync-period flag. Dynamically control the replicas of the pods based on a defined objective such as the CPU usage being X % The HorizontalPodAutoscaler normally fetches metrics from a series of aggregated APIs (metrics.k8s.io, custom.metrics.k8s.io, and external.metrics.k8s.io) There are 2 kinds of metrics that the HPA can act upon. Per-pod resource metrics. (These are the metrics fetched from the resource metrics API for each pod. Metrics such as cpu, memory are targetted in this case) Per-pod Custom metrics. (These are the metrics that are reported by your monitoring pipeline in this case prometheus, these would change from a case by case basis since metrics for scaling would be different for different implementations)
  4. Cluster Autoscaler is a tool that automatically adjusts the size of the Kubernetes cluster when: there are pods that failed to run in the cluster due to insufficient resources. some nodes in the cluster are so underutilized, for an extended period of time, that they can be deleted and their pods will be easily placed on some other, existing nodes.