cluster-autoscaler-1

Cluster Autoscaler Monitoring with Prometheus and Grafana

Published on August 29, 2025, 14:00 UTC 3 minutes New!

Cluster autoscaler is a popular tool for automatically adjusting the size of a Kubernetes cluster based on the current workload. It helps ensure that your applications have enough resources to run efficiently while minimizing costs by scaling down unused nodes. However, monitoring the cluster autoscaler is crucial to ensure that it is functioning correctly and that your applications are running smoothly.

I’ve written multiple blog posts on Kubernetes autoscaling monitoring, including Comprehensive Kubernetes Autoscaling Monitoring with Prometheus and Grafana, Karpenter Monitoring with Prometheus and Grafana, Keda Monitoring With Prometheus and Grafana and Configuring VPA to Use Historical Metrics for Recommendations and Expose Them in Kube-state-metrics. This post focuses on monitoring Cluster Autoscaler with Prometheus and Grafana, but is still be apart of the same Github repository as the other posts, so you can find all the code and configuration files in one place.

The repository is the kubernetes-autoscaling-mixin on Github. It contains Grafana dashboards and Prometheus rules for Keda, HPA, VPA, Cluster Autoscaler, PDBs, and Karpenter.

There is already one dashboards that published in Grafana:

There are also Prometheus alerts stored in GitHub that you can import that cover the common Cluster Autoscaler issues.

Enabling Metric Collection for Cluster Autoscaler

To monitor Cluster Autoscaler, you need to enable metric collection. This is typically done by enabling a service monitor for Cluster Autoscaler in your Kubernetes cluster.

Using Helm, you should deploy Cluster Autoscaler with the following values:

serviceMonitor:
  enabled: true

Grafana Dashboards

Cluster Autoscaler

The Grafana dashboard for Cluster Autoscaler provides insights into the scaling operation that occur. Its panels include:

  • Node Pool graphs - Displays the current and desired number of nodes in each node pool, along with the number of nodes that are in the process of being added or removed. This helps you understand how the Cluster Autoscaler is adjusting the size of your cluster based on workload demands.
  • Scaling Events - Shows a timeline of scaling events, including when nodes were added or removed from the cluster. This helps you track the history of scaling operations and identify any patterns or trends.
  • Pod Scheduling - Displays the number of pods that are pending, running, or failed to schedule.

Cluster-autoscaler-1

Prometheus Alerts

Alerts are trickier to get right for a generic use case, however they’re still provided by the Kubernetes-autoscaling-mixin. They’re also configurable with the config.libsonnet package in the repository, if you are familiar with Jsonnet then customizing the alerts should be fairly straight forward. Alerts are available on GitHub, and I’ll add a description for the alerts below.

  • Alert name: ClusterAutoscalerNodeCountNearCapacity

Alert triggers when the number of nodes in a node pool is close to its maximum capacity. This indicates that the cluster may not be able to scale up further to accommodate additional workloads.

  • Alert name: ClusterAutoscalerUnschedulablePods

Alert triggers when there are pods in the cluster that are unschedulable for a prolonged period. This indicates that the Cluster Autoscaler may not be able to find suitable nodes to schedule these pods, which could lead to application downtime.

Related Posts

Keda Monitoring With Prometheus and Grafana

Keda is a tool that provides event-driven autoscaling for Kubernetes, allowing you to scale your applications based on external metrics. It uses the Kubernetes Horizontal Pod Autoscaler (HPA) to adjust the number of pods in a deployment based on metrics like CPU usage, memory usage, or custom metrics from external sources. It also supports scaling based on event sources like message queues, databases as a job and defines a new Custom Resource Definition (CRD) called ScaledJob to configure the scaling behavior. Monitoring Keda effectively is crucial to ensure that your autoscaling policies are working as expected and that your applications are performing optimally.

Configuring VPA to Use Historical Metrics for Recommendations and Expose Them in Kube-state-metrics

The Vertical Pod Autoscaler (VPA) can manage both your pods’ resource requests but also recommend what the limits and requests for a pod should be. Recently, the kube-state-metrics project removed built-in support for VPA recommendation metrics, which made the VPA require additional configuration to be valuable. This blog post will cover how to configure the VPA to expose the recommendation metrics and how to visualize them in Grafana.

Configuring Kube-prometheus-stack Dashboards and Alerts for K3s Compatibility

The kube-prometheus-stack Helm chart, which deploys the kubernetes-mixin, is designed for standard Kubernetes setups, often pre-configured for specific cloud environments. However, these configurations are not directly compatible with k3s, a lightweight Kubernetes distribution. Since k3s lacks many of the default cloud integrations, issues arise, such as missing metrics, broken graphs, and unavailable endpoints (example issue). This blog post will guide you through adapting the kube-prometheus-stack Helm chart and the kubernetes-mixin to work seamlessly in k3s environments, ensuring functional dashboards and alerts tailored to k3s.

Shynet