Created
March 8, 2025 14:33
-
-
Save chadmcrowell/5feb290dc78f8d2868eb8d3ebdbb1683 to your computer and use it in GitHub Desktop.
HPA with Stabilization window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: autoscaling/v2 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: nginx-hpa | |
spec: | |
scaleTargetRef: | |
apiVersion: apps/v1 | |
kind: Deployment | |
name: nginx-deployment | |
minReplicas: 2 | |
maxReplicas: 10 | |
metrics: | |
- type: Resource | |
resource: | |
name: cpu | |
target: | |
type: Utilization | |
averageUtilization: 50 | |
behavior: | |
scaleDown: | |
stabilizationWindowSeconds: 300 # 5 minutes | |
policies: | |
- type: Percent | |
value: 10 | |
periodSeconds: 60 | |
scaleUp: | |
stabilizationWindowSeconds: 0 # Immediate scaling up | |
policies: | |
- type: Pods | |
value: 4 | |
periodSeconds: 60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment