-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8.yaml
334 lines (334 loc) · 13.5 KB
/
k8.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
apiVersion: v1 # API version
kind: Service # Type of kubernetes resource
metadata:
name: user-service-postgres # Name of the service
labels: # Labels that will be applied to the service
app: user-service
spec:
ports:
- port: 5432
selector: # Selects any Pod with labels `app=user-service,tier=postgres`
app: user-service
tier: postgres
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment # Type of the kubernetes resource
metadata:
name: user-service-postgres-deployment # Name of the deployment
labels: # Labels applied to this deployment
app: user-service
spec:
selector:
matchLabels: # This deployment applies to the Pods matching the specified labels
app: user-service
tier: postgres
strategy:
type: Recreate
template: # Template for the Pods in this deployment
metadata:
labels: # Labels to be applied to the Pods in this deployment
app: user-service
tier: postgres
spec: # The spec for the containers that will be run inside the Pods in this deployment
containers:
- image: postgres:latest # The container image
name: postgres
env: # Environment variables passed to the container
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: dev-db-secret
key: POSTGRES_PASSWORD
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: dev-db-secret
key: POSTGRES_DB
ports:
- containerPort: 5432 # The port that the container exposes
name: postgres
---
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: user-service-server-deployment # Name of the deployment
labels: # Labels that will be applied to this deployment
app: user-service-server
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods mayching the specified labels
app: user-service-server
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: user-service-server
spec: # Spec for the containers that will be run in the Pods
containers:
- name: user-service-server
image: cindy5656/userservice:latest
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8051 # The port that the container exposes
resources:
limits:
cpu: 0.2
memory: "200Mi"
env: # Environment variables supplied to the Pod
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: dev-db-secret
key: POSTGRES_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: dev-db-secret
key: POSTGRES_PASSWORD
- name: POSTGRESQL_DB_HOST
value: "user-service-postgres"
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: user-service-server # Name of the service
labels: # Labels that will be applied to this service
app: user-service-server
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it. Allowing connections from outside the cluster
selector:
app: user-service-server # The service exposes Pods with label `app=user-service-server`
ports: # Forward incoming connections on port 8080 to the target port 8051
- name: http
port: 8051
targetPort: 8051
---
apiVersion: v1 # API version
kind: Service # Type of kubernetes resource
metadata:
name: clothes-service-mongo # Name of the service
labels: # Labels that will be applied to the service
app: clothes-service
spec:
ports:
- port: 27017
selector:
app: clothes-service
tier: mongo
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment # Type of the kubernetes resource
metadata:
name: clothes-service-mongo-deployment # Name of the deployment
labels: # Labels applied to this deployment
app: clothes-service
spec:
selector:
matchLabels: # This deployment applies to the Pods matching the specified labels
app: clothes-service
tier: mongo
strategy:
type: Recreate
template: # Template for the Pods in this deployment
metadata:
labels: # Labels to be applied to the Pods in this deployment
app: clothes-service
tier: mongo
spec: # The spec for the containers that will be run inside the Pods in this deployment
containers:
- image: mongo:latest # The container image
name: mongo
ports:
- containerPort: 27017 # The port that the container exposes
name: mongo
---
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: clothes-service-server-deployment # Name of the deployment
labels: # Labels that will be applied to this deployment
app: clothes-service-server
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods mayching the specified labels
app: clothes-service-server
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: clothes-service-server
spec: # Spec for the containers that will be run in the Pods
containers:
- name: clothes-service-server
image: 990604/clothesservice:latest
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8053 # The port that the container exposes
resources:
limits:
cpu: 0.2
memory: "200Mi"
env: # Environment variables supplied to the Pod
- name: MONGODB_HOST
value: "clothes-service-mongo"
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: clothes-service-server # Name of the service
labels: # Labels that will be applied to this service
app: clothes-service-server
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it. Allowing connections from outside the cluster
selector:
app: clothes-service-server # The service exposes Pods with label `app=clothes-service-server`
ports: # Forward incoming connections on port 8080 to the target port 8053
- name: http
port: 8053
targetPort: 8053
---
apiVersion: v1 # API version
kind: Service # Type of kubernetes resource
metadata:
name: order-service-mongo # Name of the service
labels: # Labels that will be applied to the service
app: order-service
spec:
ports:
- port: 17017
selector:
app: order-service
tier: mongo
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment # Type of the kubernetes resource
metadata:
name: order-service-mongo-deployment # Name of the deployment
labels: # Labels applied to this deployment
app: order-service
spec:
selector:
matchLabels: # This deployment applies to the Pods matching the specified labels
app: order-service
tier: mongo
strategy:
type: Recreate
template: # Template for the Pods in this deployment
metadata:
labels: # Labels to be applied to the Pods in this deployment
app: order-service
tier: mongo
spec: # The spec for the containers that will be run inside the Pods in this deployment
containers:
- image: mongo:latest # The container image
name: mongo
ports:
- containerPort: 17017 # The port that the container exposes
name: mongo
---
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: order-service-server-deployment # Name of the deployment
labels: # Labels that will be applied to this deployment
app: order-service-server
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods mayching the specified labels
app: order-service-server
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: order-service-server
spec: # Spec for the containers that will be run in the Pods
containers:
- name: order-service-server
image: wardbeyens/orderservice:latest
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8052 # The port that the container exposes
resources:
limits:
cpu: 0.2
memory: "200Mi"
env: # Environment variables supplied to the Pod
- name: MONGODB_HOST
value: "order-service-mongo"
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: order-service-server # Name of the service
labels: # Labels that will be applied to this service
app: order-service-server
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it. Allowing connections from outside the cluster
selector:
app: order-service-server # The service exposes Pods with label `app=order-service-server`
ports: # Forward incoming connections on port 8080 to the target port 8052
- name: http
port: 8052
targetPort: 8052
---
apiVersion: apps/v1 # API version
kind: Deployment # Type of kubernetes resource
metadata:
name: zephyr-service-server-deployment # Name of the deployment
labels: # Labels that will be applied to this deployment
app: zephyr-service-server
spec:
replicas: 1 # No. of replicas/pods to run in this deployment
selector:
matchLabels: # The deployment applies to any pods mayching the specified labels
app: zephyr-service-server
template: # Template for creating the pods in this deployment
metadata:
labels: # Labels that will be applied to each Pod in this deployment
app: zephyr-service-server
spec: # Spec for the containers that will be run in the Pods
containers:
- name: zephyr-service-server
image: wardbeyens/zephyr-edge-service:latest
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8050 # The port that the container exposes
resources:
limits:
cpu: 0.2
memory: "200Mi"
env: # Environment variables supplied to the Pod
- name: USER_SERVICE_HOST
value: "user-service-server"
- name: USER_SERVICE_PORT
value: "8051"
- name: ORDER_SERVICE_HOST
value: "order-service-server"
- name: ORDER_SERVICE_PORT
value: "8052"
- name: CLOTHES_SERVICE_HOST
value: "clothes-service-server"
- name: CLOTHES_SERVICE_PORT
value: "8053"
---
apiVersion: v1 # API version
kind: Service # Type of the kubernetes resource
metadata:
name: zephyr-service-server # Name of the service
labels: # Labels that will be applied to this service
app: zephyr-service-server
spec:
type: NodePort # The service will be exposed by opening a Port on each node and proxying it. Allowing connections from outside the cluster
selector:
app: zephyr-service-server # The service exposes Pods with label `app=zephyr-service-server`
ports: # Forward incoming connections on port 8080 to the target port 8050
- name: http
port: 8050
targetPort: 8050