-
Notifications
You must be signed in to change notification settings - Fork 21
/
03-php-hpa.yaml
39 lines (39 loc) · 1.06 KB
/
03-php-hpa.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# When you use the Google Cloud console, HorizontalPodAutoscaler objects are created using the autoscaling/v2 API.
# https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling#api-versions
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: php-apache
namespace: doit-lab-13
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: php-apache
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
# default behavior: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#default-behavior
behavior:
scaleDown:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 25
periodSeconds: 30
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 60
- type: Pods
value: 4
periodSeconds: 30
selectPolicy: Max