Explain this openshift resource manifest
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: hpa-resource-metrics-memory
namespace: default
spec:
...
minReplicas: 20
...
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Pods
value: 4
periodSeconds: 30
- type: Percent
value: 10
periodSeconds: 60
selectPolicy: Max
scaleUp:
selectPolicy: Disabled
The provided resource manifest is for a HorizontalPodAutoscaler (HPA) which automatically scales the number of pods in a deployment or replica set based on observed resource usage or other metrics.
This HorizontalPodAutoscaler is set to:
This configuration helps manage the number of replicas in response to changing workload demands while preventing rapid scaling oscillations.
Minimum 20 replicas running, scalling down is gradually with 10% cut down every minute or 4 pods every 30 seconds, which ever is bigger.
Scaling up targeting utilization without specific policy.
HorizontalPodAutoscaler (HPA) in OpenShift manages pod scaling based on % resource usage.
ensures at least 20 pods are always running (minReplicas: 20).
Scaling down : It can remove up to 4 pods every 30 seconds or 10% of pods every 60 seconds.
Scaling up is disabled, meaning new pods won’t be added automatically.
Is that an old manifest? The latest stable version of the Horizontal Pod Autoscaler (HPA) API is: apiVersion: autoscaling/v2 was introduced in Kubernetes 1.23 and became stable (GA) in Kubernetes 1.26.
Other than what others already said, I present my concerns, what is not there instead of what is there!!
Some Concerns:
1- With scaling up disabled, the system can't automatically handle increased load
scaleUp: selectPolicy: Disabled
2- The minimum of 20 replicas might be resource-intensive if not needed, haven't seen it in my 6+ years of K8s operations?!
3- The 5-minute stabilization window might be too long for most workloads
4- Having two scale-down policies introduces confusion as well might lead to aggressive scaling in some scenarios
Thoughts:
Update to the right/latest API version for HPA.
Doesn't want automatic scaling up (possibly handled by other mechanisms?!)
Needs careful, controlled scaling down?!
Requires high availability (minimum 20 pods)?!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.