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
| Property | Value |
|---|---|
| Entity code | K8SHPA |
| Display name | K8s HPA |
| Plural | K8s HPAs |
| Level | 408 |
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
| Field | Type | Required | Notes |
|---|---|---|---|
name | text | Yes | Horizontal Pod Autoscaler name |
namespace | reference → K8SNAMESPACE | Yes | Namespace. |
targetWorkload | reference → K8SWORKLOAD | Yes | Target Workload. |
status | enum | Yes | Valid ids: 1 (Active), 2 (Disabled), 3 (Failed), 4 (Unknown). |
enabled | boolean | Enabled. |
Scaling Configuration
| Field | Type | Required | Notes |
|---|---|---|---|
minReplicas | number | Yes | Min Replicas. |
maxReplicas | number | Yes | Max Replicas. |
currentReplicas | number | Current Replicas. | |
desiredReplicas | number | Desired Replicas. | |
scaleUpRate | number | Max % increase per period | |
scaleDownRate | number | Max % decrease per period |
Behavior Settings
| Field | Type | Required | Notes |
|---|---|---|---|
scaleUpStabilization | number | Wait time before scaling up | |
scaleDownStabilization | number | Wait time before scaling down | |
scaleUpPeriod | number | Scale Up Period (sec). | |
scaleDownPeriod | number | Scale Down Period (sec). | |
scaleUpPods | number | Max pods to add at once | |
scaleDownPods | number | Max pods to remove at once |
Resource Metrics
| Field | Type | Required | Notes |
|---|---|---|---|
cpuTargetUtilization | number | Target CPU utilization | |
cpuCurrentUtilization | gauge | Current CPU %. | |
memoryTargetUtilization | number | Target memory utilization | |
memoryCurrentUtilization | gauge | Current Memory %. | |
cpuTargetValue | number | Absolute CPU target | |
memoryTargetValue | number | Absolute memory target |
Custom Metrics
| Field | Type | Required | Notes |
|---|---|---|---|
customMetrics | text (multi-line) | Custom metric definitions (JSON) | |
externalMetrics | text (multi-line) | External metric sources (JSON) | |
metricsServer | text | Custom metrics endpoint |
Advanced Metrics
| Field | Type | Required | Notes |
|---|---|---|---|
requestsPerSecondTarget | number | Requests per second target | |
latencyTarget | number | P95 latency target | |
queueLengthTarget | number | Queue Length Target. | |
customMetricType | enum | Valid ids: 1 (Resource), 2 (Pods), 3 (Object), 4 (External), 5 (ContainerResource). |
Scaling Policies
| Field | Type | Required | Notes |
|---|---|---|---|
scalingPolicy | enum | Valid ids: 1 (Default), 2 (Conservative), 3 (Aggressive), 4 (Custom). | |
labels | text (multi-line) | Key-value pairs (JSON) | |
annotations | text (multi-line) | Key-value pairs (JSON) | |
preventFlapping | boolean | Avoid rapid scale changes | |
predictiveScaling | boolean | Use ML for predictions |
Scaling History
| Field | Type | Required | Notes |
|---|---|---|---|
lastScaleTime | datetime | Last Scale Event. | |
lastScaleDirection | enum | Valid ids: 1 (Up), 2 (Down), 3 (None). | |
scaleUpCount | number | Scale Up Events (24h). | |
scaleDownCount | number | Scale Down Events (24h). | |
scalingHistory | text (multi-line) | Recent scaling events with reasons |
Performance Metrics
| Field | Type | Required | Notes |
|---|---|---|---|
avgResponseTime | gauge | Avg Response Time. | |
scalingEfficiency | gauge | How well scaling meets demand | |
overProvisioningRate | gauge | Over-provisioning %. | |
underProvisioningRate | gauge | Under-provisioning %. | |
avgScaleLatency | number | Avg Scale Latency (sec). | |
targetAchievement | gauge | Target Achievement %. | |
costOptimization | gauge | Cost Optimization %. | |
stabilityScore | gauge | Stability Score. |
Optimization Recommendations
| Field | Type | Required | Notes |
|---|---|---|---|
recommendations | text (multi-line) | AI-generated optimization suggestions | |
recommendedMinReplicas | number | Recommended Min. | |
recommendedMaxReplicas | number | Recommended Max. | |
recommendedTargetCPU | number | Recommended CPU Target %. | |
potentialSavings | number | Potential Monthly Savings. | |
performanceImprovement | gauge | Potential Performance Gain %. |
Scaling Constraints
| Field | Type | Required | Notes |
|---|---|---|---|
timeWindows | text (multi-line) | Allowed scaling times (JSON) | |
blackoutPeriods | text (multi-line) | No scaling periods (JSON) | |
maxScaleVelocity | number | Max replicas change per minute | |
cooldownPeriod | number | Cooldown Period (sec). | |
nodeSelector | text (multi-line) | Node constraints for scaled pods | |
resourceQuota | text (multi-line) | Resource limits (JSON) |
HPA Events
| Field | Type | Required | Notes |
|---|---|---|---|
events | text (multi-line) | Last 50 HPA events | |
warningCount | number | Warning Events (24h). | |
errorCount | number | Error Events (24h). |
Relationships
- Lookups:
namespacepoints at aK8SNAMESPACErecord;targetWorkloadpoints at aK8SWORKLOADrecord.
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>