Skip to content

Cluster Autoscaler (CA)

Cluster Autoscaler (CA) is a cluster-level component for Kubernetes that automatically adjusts the size of the node pool^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]. Its primary function is to manage the number of nodes, scaling the cluster out when load is high and scaling it in when load is low^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md].

As a cluster-level tool, it is typically utilized in managed cloud environments like GCP GKE or AWS EKS rather than local single-node environments like Docker Desktop^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md].

Scaling Behavior

The autoscaler operates based on the state of pods and resource utilization:

  • Scale-up: The process is triggered when a Pod remains in an unschedulable state for approximately ten seconds^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]. While the decision to scale up happens rapidly, the actual time for a new node to become available can range from a few minutes to over ten minutes^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md].
  • Scale-down: The system periodically checks (defaulting to every ten seconds) if the sum of CPU and memory requests has dropped below 50%^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md]. If this threshold is met and there are no scheduling restrictions, the cluster will reduce the number of nodes.

Constraints and Configuration

Specific conditions and configurations can prevent the Cluster Autoscaler from modifying the cluster:

  • Pod Disruption and Affinity: The scale-down process may be blocked if evicting a Pod would violate PodDisruptionBudget rules or Pod affinity/anti-affinity settings^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md].
  • Manual Annotations: Administrators can prevent specific nodes from being scaled down by adding the annotation "cluster-autoscaler.kubernetes.io/scale-down-disabled": "true"^[400-devops__06-Kubernetes__k8s-ithelp__Day25__README.md].
  • [[Horizontal Pod Autoscaler (HPA)]]
  • [[Vertical Pod Autoscaler (VPA)]]
  • [[Multidim Pod Autoscaler (MPA)]]

Sources