Skip to content

Instantly share code, notes, and snippets.

@initcron
Last active January 23, 2024 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save initcron/fe34915fd222583e3170f4f88fc1054f to your computer and use it in GitHub Desktop.
Save initcron/fe34915fd222583e3170f4f88fc1054f to your computer and use it in GitHub Desktop.
HPA v2 Spec for Vote App
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: vote
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- type: ContainerResource
containerResource:
name: cpu
container: app
target:
type: Utilization
averageUtilization: 50
scaleTargetRef:
apiVersion: apps/v1
kind: ReplicaSet
name: vote
behavior:
scaleDown:
policies:
- type: Pods
value: 2
periodSeconds: 120
- type: Percent
value: 25
periodSeconds: 120
stabilizationWindowSeconds: 300
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 2
periodSeconds: 15
selectPolicy: Max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment