DemandFlow Support Centre

K8SHPA: K8s HPA

ReferenceEntity Reference16/04/2026Updated 16/04/2026
A Kubernetes Horizontal Pod Autoscaler that automatically adjusts workload replica counts based on resource utilisation or custom metrics.

K8SHPA: K8s HPA

A Kubernetes Horizontal Pod Autoscaler that automatically adjusts workload replica counts based on resource utilisation or custom metrics.

Default definition. This article describes the default K8SHPA definition shipped with DemandFlow. Administrators can add, remove, rename, or re-type fields, change which ones are required, and alter the layout from the Definitions screen in Settings. Your tenant's current schema may differ from what is shown here. To read the current definition at any time, GET the DEFINITION object whose id matches K8SHPA.

Entity properties

PropertyValue
Entity codeK8SHPA
Display nameK8s HPA
PluralK8s HPAs
Level408

Use cases

K8SHPA models the HorizontalPodAutoscaler resource, one of the most operationally impactful Kubernetes objects. The General panel links to both K8SNAMESPACE and the target K8SWORKLOAD (objectLookup), establishing the autoscaler-to-workload relationship. Scaling Configuration captures min/max replicas, current/desired counts, and scale-up/down rates.

Fields

HPA Information

FieldTypeRequiredNotes
nametextYesHorizontal Pod Autoscaler name
namespacereference → K8SNAMESPACEYesNamespace.
targetWorkloadreference → K8SWORKLOADYesTarget Workload.
statusenumYesValid ids: 1 (Active), 2 (Disabled), 3 (Failed), 4 (Unknown).
enabledbooleanEnabled.

Scaling Configuration

FieldTypeRequiredNotes
minReplicasnumberYesMin Replicas.
maxReplicasnumberYesMax Replicas.
currentReplicasnumberCurrent Replicas.
desiredReplicasnumberDesired Replicas.
scaleUpRatenumberMax % increase per period
scaleDownRatenumberMax % decrease per period

Behavior Settings

FieldTypeRequiredNotes
scaleUpStabilizationnumberWait time before scaling up
scaleDownStabilizationnumberWait time before scaling down
scaleUpPeriodnumberScale Up Period (sec).
scaleDownPeriodnumberScale Down Period (sec).
scaleUpPodsnumberMax pods to add at once
scaleDownPodsnumberMax pods to remove at once

Resource Metrics

FieldTypeRequiredNotes
cpuTargetUtilizationnumberTarget CPU utilization
cpuCurrentUtilizationgaugeCurrent CPU %.
memoryTargetUtilizationnumberTarget memory utilization
memoryCurrentUtilizationgaugeCurrent Memory %.
cpuTargetValuenumberAbsolute CPU target
memoryTargetValuenumberAbsolute memory target

Custom Metrics

FieldTypeRequiredNotes
customMetricstext (multi-line)Custom metric definitions (JSON)
externalMetricstext (multi-line)External metric sources (JSON)
metricsServertextCustom metrics endpoint

Advanced Metrics

FieldTypeRequiredNotes
requestsPerSecondTargetnumberRequests per second target
latencyTargetnumberP95 latency target
queueLengthTargetnumberQueue Length Target.
customMetricTypeenumValid ids: 1 (Resource), 2 (Pods), 3 (Object), 4 (External), 5 (ContainerResource).

Scaling Policies

FieldTypeRequiredNotes
scalingPolicyenumValid ids: 1 (Default), 2 (Conservative), 3 (Aggressive), 4 (Custom).
labelstext (multi-line)Key-value pairs (JSON)
annotationstext (multi-line)Key-value pairs (JSON)
preventFlappingbooleanAvoid rapid scale changes
predictiveScalingbooleanUse ML for predictions

Scaling History

FieldTypeRequiredNotes
lastScaleTimedatetimeLast Scale Event.
lastScaleDirectionenumValid ids: 1 (Up), 2 (Down), 3 (None).
scaleUpCountnumberScale Up Events (24h).
scaleDownCountnumberScale Down Events (24h).
scalingHistorytext (multi-line)Recent scaling events with reasons

Performance Metrics

FieldTypeRequiredNotes
avgResponseTimegaugeAvg Response Time.
scalingEfficiencygaugeHow well scaling meets demand
overProvisioningRategaugeOver-provisioning %.
underProvisioningRategaugeUnder-provisioning %.
avgScaleLatencynumberAvg Scale Latency (sec).
targetAchievementgaugeTarget Achievement %.
costOptimizationgaugeCost Optimization %.
stabilityScoregaugeStability Score.

Optimization Recommendations

FieldTypeRequiredNotes
recommendationstext (multi-line)AI-generated optimization suggestions
recommendedMinReplicasnumberRecommended Min.
recommendedMaxReplicasnumberRecommended Max.
recommendedTargetCPUnumberRecommended CPU Target %.
potentialSavingsnumberPotential Monthly Savings.
performanceImprovementgaugePotential Performance Gain %.

Scaling Constraints

FieldTypeRequiredNotes
timeWindowstext (multi-line)Allowed scaling times (JSON)
blackoutPeriodstext (multi-line)No scaling periods (JSON)
maxScaleVelocitynumberMax replicas change per minute
cooldownPeriodnumberCooldown Period (sec).
nodeSelectortext (multi-line)Node constraints for scaled pods
resourceQuotatext (multi-line)Resource limits (JSON)

HPA Events

FieldTypeRequiredNotes
eventstext (multi-line)Last 50 HPA events
warningCountnumberWarning Events (24h).
errorCountnumberError Events (24h).

Relationships

  • Lookups: namespace points at a K8SNAMESPACE record; targetWorkload points at a K8SWORKLOAD record.

Creating a K8s HPA via the API

POST /v1/objects
Authorization: Bearer <your-pat>
Content-Type: application/json

{
  "entity":   "K8SHPA",
  "level":    408,
  "comboKey": "SUB:<your-sub-id>|ENT:",
  "name": "Example",
  "namespace": "",
  "targetWorkload": "",
  "status": "1"
}

Listing K8s HPAs

# All records in your tenant
GET /v1/entities/K8SHPA/SUB:<your-sub-id>

See also

k8shpak8shpahpas

Was this article helpful?

← Back to Knowledge Base