-
Notifications
You must be signed in to change notification settings - Fork 0
/
ppdd.yml
351 lines (338 loc) · 7.61 KB
/
ppdd.yml
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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# A Kubernetes file to deploy the Ping-Pong-Ding-Dong services
---
# ConfigMaps
# NOTE! You need to quote the data values or you'll get an error when trying
# to deploy as they are referenced in the Deployment. The error will be
# something like:
# error ... ConfigMap in version "v1" cannot be handled as a ConfigMap ...
apiVersion: v1
kind: ConfigMap
metadata:
name: dev
data:
http_port: "8080"
namespace: "default"
ping_port: "8080"
pong_port: "8080"
ding_port: "8080"
dong_port: "8080"
---
# Ping Service
apiVersion: v1
kind: Service
metadata:
name: ping
labels:
app: ping
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30001
protocol: TCP
selector:
app: ping
---
# Pong Service
apiVersion: v1
kind: Service
metadata:
name: pong
labels:
app: pong
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30002
protocol: TCP
selector:
app: pong
---
# Ding Service
apiVersion: v1
kind: Service
metadata:
name: ding
labels:
app: ding
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30003
protocol: TCP
selector:
app: ding
---
# Dong Service
apiVersion: v1
kind: Service
metadata:
name: dong
labels:
app: dong
spec:
type: NodePort
ports:
- port: 8080
nodePort: 30004
protocol: TCP
selector:
app: dong
---
# Deployment for the ping service
apiVersion: apps/v1
kind: Deployment
metadata:
name: ping-deploy
spec:
replicas: 2
selector:
matchLabels:
app: ping
revisionHistoryLimit: 5
progressDeadlineSeconds: 300
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: ping
spec:
containers:
- name: ping-pong-ding-dong
image: "ghcr.io/michaelerickson/ping-pong-ding-dong:d65d4373da"
ports:
- containerPort: 8080
env:
- name: PPDD_MODE
value: ping
- name: HTTP_PORT
valueFrom:
configMapKeyRef:
name: dev
key: http_port
- name: NAMESPACE
valueFrom:
configMapKeyRef:
name: dev
key: namespace
- name: PING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ping_port
- name: PONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: pong_port
- name: DING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ding_port
- name: DONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: dong_port
imagePullSecrets:
- name: ghcr.io
---
# Deployment for the pong service
apiVersion: apps/v1
kind: Deployment
metadata:
name: pong-deploy
spec:
replicas: 2
selector:
matchLabels:
app: pong
revisionHistoryLimit: 5
progressDeadlineSeconds: 300
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: pong
spec:
containers:
- name: ping-pong-ding-dong
image: "ghcr.io/michaelerickson/ping-pong-ding-dong:d65d4373da"
ports:
- containerPort: 8080
env:
- name: PPDD_MODE
value: pong
- name: HTTP_PORT
valueFrom:
configMapKeyRef:
name: dev
key: http_port
- name: NAMESPACE
valueFrom:
configMapKeyRef:
name: dev
key: namespace
- name: PING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ping_port
- name: PONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: pong_port
- name: DING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ding_port
- name: DONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: dong_port
imagePullSecrets:
- name: ghcr.io
---
# Deployment for the ding service
apiVersion: apps/v1
kind: Deployment
metadata:
name: ding-deploy
spec:
replicas: 2
selector:
matchLabels:
app: ding
revisionHistoryLimit: 5
progressDeadlineSeconds: 300
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: ding
spec:
containers:
- name: ping-pong-ding-dong
image: "ghcr.io/michaelerickson/ping-pong-ding-dong:d65d4373da"
ports:
- containerPort: 8080
env:
- name: PPDD_MODE
value: ding
- name: HTTP_PORT
valueFrom:
configMapKeyRef:
name: dev
key: http_port
- name: NAMESPACE
valueFrom:
configMapKeyRef:
name: dev
key: namespace
- name: PING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ping_port
- name: PONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: pong_port
- name: DING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ding_port
- name: DONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: dong_port
imagePullSecrets:
- name: ghcr.io
---
# Deployment for the dong service
apiVersion: apps/v1
kind: Deployment
metadata:
name: dong-deploy
spec:
replicas: 2
selector:
matchLabels:
app: dong
revisionHistoryLimit: 5
progressDeadlineSeconds: 300
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: dong
spec:
containers:
- name: ping-pong-ding-dong
image: "ghcr.io/michaelerickson/ping-pong-ding-dong:d65d4373da"
ports:
- containerPort: 8080
env:
- name: PPDD_MODE
value: dong
- name: HTTP_PORT
valueFrom:
configMapKeyRef:
name: dev
key: http_port
- name: NAMESPACE
valueFrom:
configMapKeyRef:
name: dev
key: namespace
- name: PING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ping_port
- name: PONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: pong_port
- name: DING_PORT
valueFrom:
configMapKeyRef:
name: dev
key: ding_port
- name: DONG_PORT
valueFrom:
configMapKeyRef:
name: dev
key: dong_port
imagePullSecrets:
- name: ghcr.io