HPA Notes

2 min read

HPA notes surface replica counts, scaling state, and scale-target details from HorizontalPodAutoscaler objects.


Reference

NoteDescription
hpaCurrentReplicasReturns `status.
hpaDesiredReplicasReturns `status.
hpaMinReplicasReturns `spec.
hpaMaxReplicasReturns `spec.
hpaScalingReturns true when the HPA has a valid metric (ScalingActive=True) and currentReplicas != desiredReplicas — a real scale-out or scale-in is in progress.
hpaScalingActiveReturns true when the ScalingActive condition is True — the HPA can read its metric and is permitted to scale.
hpaAbleToScaleReturns true when the AbleToScale condition is True — the scale target exists and is reachable.
hpaScalingLimitedReturns true when the ScalingLimited condition is True — the desired replica count was clamped by the min or max bound.
hpaAtMaxReturns true when currentReplicas >= maxReplicas — the HPA has hit its ceiling.
hpaScaleTargetNameReturns `_scaleTarget.
hpaScaleTargetKindReturns `_scaleTarget.
hpaMetricTypesReturns a comma-separated list of metric source types from _currentMetrics.

Examples

# hpaCurrentReplicas
- path: currentReplicas
  value: "{{ hpaCurrentReplicas .children.hpa }}"
# → 3

# hpaDesiredReplicas
- path: desiredReplicas
  value: "{{ hpaDesiredReplicas .children.hpa }}"
# → 5

# hpaMinReplicas
- path: minReplicas
  value: "{{ hpaMinReplicas .children.hpa }}"
# → 2

# hpaMaxReplicas
- path: maxReplicas
  value: "{{ hpaMaxReplicas .children.hpa }}"
# → 10

# hpaScaling
when:
  - field: "{{ hpaScaling .children.hpa }}"
    equals: "false"

# hpaScalingActive
- path: metricsReady
  value: "{{ hpaScalingActive .children.hpa }}"

# hpaAbleToScale
- path: targetReachable
  value: "{{ hpaAbleToScale .children.hpa }}"

# hpaScalingLimited
- path: atBound
  value: "{{ hpaScalingLimited .children.hpa }}"

# hpaAtMax
- path: atCapacity
  value: "{{ hpaAtMax .children.hpa }}"

# hpaScaleTargetName
- path: scaleTargetName
  value: "{{ hpaScaleTargetName .children.hpa }}"
# → "my-app"

# hpaScaleTargetKind
- path: scaleTargetKind
  value: "{{ hpaScaleTargetKind .children.hpa }}"
# → "Deployment"

# hpaMetricTypes
- path: metricTypes
  value: "{{ hpaMetricTypes .children.hpa }}"
# → "Resource, External"