-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
153 lines (148 loc) · 2.72 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
namespace: default
labels:
app: backend
spec:
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
replicas: 2
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
resources:
requests:
cpu: 200m
memory: 250Mi
limits:
cpu: 500m
image: 024848437933.dkr.ecr.ap-northeast-2.amazonaws.com/paperple-spring:v0.0.87
ports:
- containerPort: 8080
imagePullSecrets:
- name: ecr-secret
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: backend
namespace: default
spec:
maxReplicas: 4
metrics:
- resource:
name: cpu
target:
averageUtilization: 50
type: Utilization
type: Resource
minReplicas: 2
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: backend
---
apiVersion: v1
kind: Service
metadata:
labels:
app: backend
name: backend-svc
namespace: default
spec:
ports:
- protocol: TCP
name: http
port: 80
targetPort: 8080
- protocol: TCP
name: https
port: 443
targetPort: 8080
selector:
app: backend
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: fastapi-ai
namespace: default
labels:
app: fastapi-ai
spec:
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
replicas: 2
selector:
matchLabels:
app: fastapi-ai
template:
metadata:
labels:
app: fastapi-ai
spec:
containers:
- name: fastapi-ai
image: 024848437933.dkr.ecr.ap-northeast-2.amazonaws.com/paperple-ai:v0.0.29
resources:
requests:
cpu: 200m
memory: 100Mi
limits:
cpu: 500m
ports:
- containerPort: 8080
imagePullSecrets:
- name: ecr-secret
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: fastapi-ai
namespace: default
spec:
maxReplicas: 4
metrics:
- resource:
name: cpu
target:
averageUtilization: 50
type: Utilization
type: Resource
minReplicas: 2
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: fastapi-ai
---
apiVersion: v1
kind: Service
metadata:
labels:
app: fastapi-ai
name: fastapi-ai-svc
namespace: default
spec:
ports:
- port: 8000
protocol: TCP
targetPort: 8000
selector:
app: fastapi-ai
type: ClusterIP