-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
70 lines (70 loc) · 1.41 KB
/
deployment.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
apiVersion: apps/v1
kind: Deployment
metadata:
name: project1-deployment
namespace: project1
spec:
selector:
matchLabels:
app: project1
replicas: 1 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: project1
spec:
containers:
- name: project1
image: thomaspoignant/hello-world-rest-json
ports:
- name: project1
containerPort: 8080
resources:
requests:
cpu: 100m
memory: 680Mi
limits:
cpu: 600m
memory: 1800Mi
terminationGracePeriodSeconds: 30
---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: project1-deployment
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: project1-deployment
minReplicas: 1
maxReplicas: 4
behavior:
scaleDown:
stabilizationWindowSeconds: 300
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
---
apiVersion: v1
kind: Service
metadata:
name: project1
namespace: project1
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: project1
type: NodePort