Skip to main content

📈 HPA Monitor

Watches for HorizontalPodAutoscalers that are stuck at max replicas for a sustained period with scaling errors.

How detection works

  1. kwatch lists all HPAs in watched namespaces
  2. Checks if status.currentReplicas ≥ spec.maxReplicas (at max capacity)
  3. Checks if scaling is blocked or failing (e.g. resource metrics unavailable)
  4. Only alerts if the condition persists beyond sustainedMinutes
  5. Resolves when the HPA scales down or scaling errors clear

Configuration

ParameterTypeDefaultDescription
hpaMonitor.enabledbooltrueEnable HPA monitoring.
hpaMonitor.sustainedMinutesint20Minutes the HPA must be at max replicas before alerting.

Example

apiVersion: v1
kind: Namespace
metadata:
name: kwatch
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kwatch
namespace: kwatch
data:
config.yaml: |
hpaMonitor:
enabled: true
sustainedMinutes: 20

What triggers an alert

  • HPA at maxReplicas with scaling failures (resource metrics unavailable, timeout, etc.)
  • Sustained for sustainedMinutes (default 20 min) — avoids noise from temporary spikes

What does NOT trigger an alert

  • HPA at maxReplicas with no scaling errors (normal — you've reached your max, that's expected)
  • HPA scaling up successfully (kwatch only alerts on failures)