📈 HPA Monitor
Watches for HorizontalPodAutoscalers that are stuck at max replicas for a sustained period with scaling errors.
How detection works
- kwatch lists all HPAs in watched namespaces
- Checks if
status.currentReplicas ≥ spec.maxReplicas(at max capacity) - Checks if scaling is blocked or failing (e.g. resource metrics unavailable)
- Only alerts if the condition persists beyond
sustainedMinutes - Resolves when the HPA scales down or scaling errors clear
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
hpaMonitor.enabled | bool | true | Enable HPA monitoring. |
hpaMonitor.sustainedMinutes | int | 20 | Minutes 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
maxReplicaswith 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
maxReplicaswith no scaling errors (normal — you've reached your max, that's expected) - HPA scaling up successfully (kwatch only alerts on failures)