βοΈ Ensure HPA has maximum replicas configured
When auto-scaling resource utilization is triggered by HPA (HorizontalPodAutoscaler), a range of acceptable values must be set to prevent unintended scaling-up scenarios.
Targeted objects by this rule (types of kind
): Pod
Complexity: medium (What does this mean?)
Policy as code identifier: HPA_MISSING_MAXREPLICAS_KEY
This rule will failβ
If an HPA doesn't have maximum replicas configured
kind: HorizontalPodAutoscaler
spec:
minReplicas: 1
Rule output in the CLIβ
$ datree test *.yaml
>> File: failExample.yaml
β Ensure HPA has maximum replicas configured [1 occurrence]
π‘ Missing property object `maxReplicas` - the value should be within the accepted boundaries recommended by the organization
How to fix this failureβ
kind: HorizontalPodAutoscaler
spec:
minReplicas: 1
maxReplicas: 10