30 lines
561 B
YAML
30 lines
561 B
YAML
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: server-autoscaler
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: server
|
|
minReplicas: 2
|
|
maxReplicas: 4
|
|
metrics:
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: 60
|
|
behavior:
|
|
scaleUp:
|
|
policies:
|
|
- type: Pods
|
|
value: 100
|
|
periodSeconds: 10
|
|
scaleDown:
|
|
policies:
|
|
- type: Pods
|
|
value: 1
|
|
periodSeconds: 300
|