Skip to content

Instantly share code, notes, and snippets.

@initcron
Last active May 5, 2024 05:17
Show Gist options
  • 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 # change this as per actual container name
target:
type: Utilization
averageUtilization: 50
scaleTargetRef:
apiVersion: apps/v1
kind: ReplicaSet # change it to Deployment if have created a deployment already
name: vote
behavior:
scaleDown:
policies:
- type: Pods
value: 2
periodSeconds: 120
- type: Percent
value: 25
periodSeconds: 120
stabilizationWindowSeconds: 60
scaleUp:
stabilizationWindowSeconds: 45
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