domino_admin_toolkit.checks.test_autoscaler_health module

pydantic model domino_admin_toolkit.checks.test_autoscaler_health.AutoscalerHealthAnalyzer

Bases: DataFrameAnalyzerBase

Fields:
field cpu_cap_fail_pct: float = 0.95

CPU used / CPU max above this triggers FAIL

field cpu_cap_warn_pct: float = 0.8

CPU used / CPU max above this triggers WARN

field mem_cap_fail_pct: float = 0.95

Memory used / memory max above this triggers FAIL

field mem_cap_warn_pct: float = 0.8

Memory used / memory max above this triggers WARN

field staleness_threshold_s: float = 300

Seconds since the CA main loop last ran above this triggers FAIL

field threshold_unschedulable_pods: int = 0

Unschedulable pod count above this triggers FAIL

analyze(data)

Analyzes the full DataFrame and returns a list of CheckResult instances.

Return type:

list[CheckResult]

Args:

data: The full DataFrame. Called once per check_df() invocation.

Returns:

List[CheckResult]: A list containing the results of the analysis.

Raises:

NotImplementedError: If this method is not implemented by subclasses.

evaluate_row(row)

Return (status, column, message) for every dimension of one autoscaler pod that tripped.

Return type:

list[tuple[Status, str, str]]

name: ClassVar[str] = 'AutoscalerHealthAnalyzer'
domino_admin_toolkit.checks.test_autoscaler_health.autoscaler_health_data(prometheus_client_v2, autoscaler_pod_name, platform_namespace)

Collect cluster autoscaler current-state health gauges from Prometheus.

domino_admin_toolkit.checks.test_autoscaler_health.test_cluster_autoscaler_health(skip_karpenter_enabled, autoscaler_health_data, runner)
Description:

Checks the current state of the cluster autoscaler from its Prometheus gauges: unschedulable pod count, the safe-to-autoscale flag, staleness of the main loop, and how close the cluster is to its configured CPU and memory maximums. Answers “is scaling broken right now?” during a live “workspaces won’t start” incident. Mirrors the Grafana alert rules in alerts/cluster-autoscaler.yaml. Not applicable to Karpenter-enabled deployments.

Failure Conditions:
  • FAIL: cluster_autoscaler_unschedulable_pods_count > threshold_unschedulable_pods (default 0)

  • FAIL: cluster_autoscaler_cluster_safe_to_autoscale == 0

  • FAIL: time() - cluster_autoscaler_last_activity{activity=”main”} > staleness_threshold_s (default 300s)

  • FAIL / WARN: cluster CPU cores / cpu_limits_cores{direction=”maximum”} > 0.95 / 0.8

  • FAIL / WARN: cluster memory bytes / memory_limits_bytes{direction=”maximum”} > 0.95 / 0.8

  • ERROR: safe_to_autoscale or last_activity returned no data (label or scrape problem)

  • ERROR: no autoscaler gauges returned from Prometheus at all

Troubleshooting Steps:
  1. Review cluster autoscaler logs for scale-up decisions and errors:

    kubectl logs -n <platform-namespace> -l app.kubernetes.io/name=cluster-autoscaler –tail=200

  2. List pending pods and their scheduling events:

    kubectl get pods -A –field-selector=status.phase=Pending kubectl describe pod <pending-pod> -n <namespace>

  3. Inspect the autoscaler’s own view of each node group:

    kubectl get configmap cluster-autoscaler-status -n <platform-namespace> -o yaml

  4. Compare node group current size against its max in the cloud provider console (EC2 Auto Scaling Groups for AWS, Node Pools for GCP/Azure).

  5. Follow the “pending pods without scale-up” and “cluster below minimum/above maximum” flows in the Cluster Autoscaler Runbook (Confluence page 1090027657).

Resolution Steps:
  1. CPU / memory cap reached: raise the node group max size, or the autoscaler’s –cores-total / –memory-total limits in its Helm values.

  2. safe_to_autoscale == 0: find and fix the unready nodes (or the node group below its minimum) that make the autoscaler refuse to act; it resumes on its own once the cluster is healthy.

  3. Stale main loop: restart the autoscaler pod and check its logs for the cause of the hang (API server throttling, cloud provider API timeouts).

  4. Unschedulable pods with headroom: check node group selectors, taints, and instance types against the pending pods’ requests; consult Domino support if they do not match.

Required Permissions:
  • Prometheus query access (cluster_autoscaler_* metrics)

  • kubectl access to the platform namespace to read pods, logs, events, and ConfigMaps

  • Cloud provider console access to view and modify node group / Auto Scaling Group settings

See also:
  • test_autoscaler_errors.py — historical errors; if current health is red, check whether errors built up over time

  • info/test_cluster_autoscaler_cm.py — per-nodegroup detail from the ConfigMap

  • test_karpenter_capacity.py — Karpenter equivalent; this check is a no-op there

  • alerts/cluster-autoscaler.yaml — Grafana alerts this check mirrors (unschedulable pods ≈ line 19, safe_to_autoscale ≈ line 109, CPU cap ≈ lines 199/218, memory cap ≈ lines 359/376)

  • Confluence CA Runbook page 1090027657 — “pending pods without scale-up” and “cluster below minimum/above maximum” flows

  • Prior art (workspaces-won’t-start P0s where the scaling-pressure read drove triage): OT-3594 (2026-02-11), OT-3578 (JnJ, 2026-01-12), OT-3608 (NYLIM, 2026-02-26)