✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Kubernetes Node Scale Up Flow

Kubernetes Node Scale Up Flow explains how and when new nodes are added to a cluster to scale infrastructure efficiently.

Kubernetes Node Scale Up Flow is the detailed sequence of steps the Cluster Autoscaler follows from detecting an unschedulable pod through to that pod actually running on newly provisioned capacity, spanning scheduling simulation, cloud provider API calls, node bootstrapping, and final scheduler placement. Understanding each stage clarifies where delay accumulates in the overall response time and where a scale-up attempt can stall or fail.


Detecting the Need to Scale

Identifying Unschedulable Pods

The Cluster Autoscaler continuously watches for pods in Pending state whose most recent scheduling attempt failed due to insufficient resources, distinguishing this from pods pending for other reasons (unsatisfied affinity rules unrelated to capacity, missing persistent volumes) which scaling up would not resolve.

kubectl get events --field-selector reason=FailedScheduling

Simulating Scheduling Against Candidate Node Groups

For each configured node group, the autoscaler simulates whether a hypothetical new node from that group, with its known instance type and capacity, would allow the pending pod (and other currently pending pods) to be scheduled, selecting the node group or combination that resolves the largest number of pending pods most efficiently.


Provisioning the New Node

Calling the Cloud Provider API

Once a node group is selected, the autoscaler calls the cloud provider's API to increase that node group's target size, which is a request to the underlying infrastructure (an auto-scaling group, a managed instance group, or equivalent) rather than something Kubernetes itself directly provisions.

--cloud-provider=aws
--node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled

Node Bootstrapping

The newly provisioned instance boots, joins the cluster by registering itself with the API server, and the kubelet begins reporting Ready status only after completing its own startup sequence — network configuration, container runtime initialization, and any node-level bootstrapping scripts specific to the environment.

kubectl get nodes -w

Scheduling the Pending Pod

Scheduler Placement Onto the New Node

Once the new node reports Ready and its resources are reflected in the scheduler's view of cluster capacity, the previously pending pod becomes eligible for scheduling and is placed onto the new node in the scheduler's normal reconciliation cycle, independent of the autoscaler itself, which has no further role once the node is available.

Pod Startup on the New Node

After scheduling, the pod still needs to be pulled (if its image is not cached on the new node), start its containers, and pass any configured readiness checks before it begins actually serving traffic, adding further time beyond node availability before the pod contributes usable capacity.


Sources of Delay Across the Flow

Cloud Provider Provisioning Time

The time between an API call requesting additional capacity and a new instance becoming available varies significantly by cloud provider, instance type, and region, and is frequently the single largest contributor to total scale-up latency, often ranging from under a minute to several minutes depending on infrastructure.

Image Pull Time on Cold Nodes

A newly provisioned node with no previously cached container images must pull every image referenced by pods scheduled onto it, which can add substantial delay for large images — pre-baking commonly used images into a custom node image, or using an image-caching daemonset, mitigates this specific delay.

Cumulative Effect on Total Response Time

The full scale-up flow's total latency is the sum of pod-pending detection, scheduling simulation, cloud provisioning time, node bootstrap time, scheduler placement, and pod startup — meaningfully longer than the reconciliation interval of the autoscaler itself, which should inform how much buffer capacity (via minReplicas on HPA-managed workloads, or maintained headroom in node groups) is kept available to absorb demand during this window.


Improving Scale-Up Responsiveness

Maintaining Buffer Capacity

Keeping a small amount of pre-provisioned headroom (through slightly conservative HPA minReplicas settings or a dedicated low-priority placeholder workload that can be preempted) absorbs sudden demand increases without waiting for the full node scale-up flow to complete.

Pre-Warming Node Images

Building custom node images with commonly used container images already present, or running a DaemonSet that proactively pulls critical images onto every node as it joins the cluster, removes image pull time from the critical path of getting a newly scaled node to useful capacity.