Enabling Cluster Autoscaler in Gardener‑Managed Shoots
Gardener’s ClusterAutoscaler field lets you deploy and configure the Kubernetes Cluster Autoscaler add‑on automatically. This blog walks through the spec changes, a concrete GKE example, how to monitor the autoscaler, and the trade‑offs you should consider before turning on autoscaling.
17 Jun 2026, 11:56 UTC

Problem: Static Shoot Clusters Don’t Scale with Demand
In a Gardener‑managed environment, each shoot cluster is provisioned with a fixed number of nodes based on the node‑pool configuration. When workloads spike, users either have to manually adjust the node‑pool size or risk throttled requests and degraded performance. Conversely, over‑provisioning leads to unnecessary cloud spend. The ideal solution is an automated, provider‑aware autoscaler that can grow and shrink node pools on demand.
Thesis: Gardener’s ClusterAutoscaler Field Automates the Autoscaler
Starting with Gardener 1.63, the ClusterAutoscaler field in the shoot spec exposes a single knob for enabling the Cluster Autoscaler add‑on. When enabled: true, Gardener injects a properly configured autoscaler pod into the shoot’s control plane, sets up RBAC, and translates the shoot’s node‑pool limits into autoscaler arguments. This removes the need to manually deploy Helm charts or manage service accounts.
What the ClusterAutoscaler Field Looks Like
| Field | Type | Description |
|---|---|---|
| enabled | boolean | Turn the autoscaler on or off. |
| minNodes | integer | Global minimum node count across all pools. |
| maxNodes | integer | Global maximum node count across all pools. |
| providerSpecific | object | Provider‑specific flags (e.g., GKE flags like maxGracefulTerminationSec). |
Concrete Example: Enabling Autoscaling on a GKE Shoot
The following snippet shows a minimal shoot spec that turns on autoscaling for a GKE shoot. It sets a global node range of 1‑10 and passes a GKE‑specific flag to fine‑tune node termination.
apiVersion: core.gardener.cloud/v1beta1
kind: Shoot
metadata:
name: example-shoot
spec:
region: europe-west1
cloudProvider: gcp
nodePools:
- name: default
machineType: e2-medium
maxSize: 10
minSize: 1
clusterAutoscaler:
enabled: true
minNodes: 1
maxNodes: 10
providerSpecific:
maxGracefulTerminationSec: 300
After applying this spec, Gardener will create a cluster-autoscaler pod in the shoot’s kube-system namespace. The pod image is pinned to a version compatible with the shoot’s Kubernetes release.
Monitoring and Verification
- Verify the autoscaler pod is running:
kubectl --context=<shoot-context> get pods -n kube-system -l app=cluster-autoscaler - Check logs for startup messages:
kubectl --context=<shoot-context> logs -n kube-system <autoscaler-pod> - Trigger a scaling event: Deploy a workload that uses more CPU than the current node pool can provide (e.g., a batch of pods with 2‑CPU requests). Then
You should see the node count increase to the target betweenkubectl --context=<shoot-context> get nodesminNodesandmaxNodes, and the GKE console will show the node‑pool size grow. - Scale down test: Reduce the workload; after the cooldown period, the autoscaler will delete idle nodes. Verify the node count decreases and that the GKE node‑pool size shrinks accordingly.
- Collect metrics: The autoscaler exposes metrics on port 8080. Configure Prometheus to scrape
http://<autoscaler-pod>.kube-system.shoot.cluster.local:8080/metricsfor detailed scaling telemetry.
Trade‑offs and Limitations
- Cost risk: A high
maxNodescan lead to unanticipated spend. Always monitor cloud billing and set realistic limits. - Provider limits: GKE, EKS, and AKS impose quotas on node‑pool scaling frequency. Exceeding these can trigger throttling or failed scale‑up attempts.
- Image compatibility: Gardener pins the autoscaler image to a specific Kubernetes‑compatible tag. Using a custom image may break functionality.
- Control‑plane load: The autoscaler pod runs in the shoot’s control plane. Heavy control‑plane traffic can cause temporary restarts, delaying scaling actions.
- Version requirement: The feature is only available in Gardener 1.63+. Earlier releases need a manual Helm deployment of the autoscaler add‑on.
Actionable Checklist
- Confirm Gardener version:
kubectl get gardener -o jsonpath='{.status.version}'should return 1.63 or newer. - Add
clusterAutoscaler.enabled: trueto your shoot spec. - Set
minNodesandmaxNodesthat match your cost and performance goals. - Deploy the shoot and watch the autoscaler pod appear.
- Run the verification steps above to ensure scaling events fire as expected.
- Configure Prometheus alerts on metrics such as
cluster_autoscaler_nodes_increasedorcluster_autoscaler_nodes_decreased. - Periodically review cloud provider dashboards to confirm node‑pool size matches the autoscaler logs.
By following these steps, you can turn a static Gardener shoot into a responsive, cost‑aware cluster that scales automatically with your workload demands.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.