Resource utilization thresholds¶
Resource utilization thresholds are configuration values used in Kubernetes AutoScaling to determine when a workload should scale up or down based on resource consumption^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md].
These thresholds are defined within the metrics section of a HorizontalPodAutoscaler (HPA) manifest and are applied to specific resources like CPU or memory^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md].
Configuration¶
In an HPA specification, the threshold is defined by the target field nested under a specific resource metric^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md].
[Metrics](<./metrics.md>):
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
Utilization types¶
The behavior of a threshold depends on the target.type specified:
- Utilization: This type represents a percentage of the resource request value^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md]. It is currently only valid for
Resourcemetric source types^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md]. For example, settingaverageUtilization: 50triggers scaling when the average usage across all relevant Pods hits 50% of their requested CPU^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md]. - AverageValue: This type defines a target value calculated as a numerical average across all Pods^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md].
- Value: This type defines a specific raw target quantity^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md].
Related Concepts¶
Sources¶
^[400-devops-06-kubernetes-k8s-ithelp-day26-readme.md]