-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplanetx-srv.yaml
505 lines (499 loc) · 15.6 KB
/
planetx-srv.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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: planetx-auth
namespace: planetx
spec:
encryptedData:
PLANET_DATABASE: AgBVK8WVKO8NBBDpfrqToL137JnpfkP4iJLYDh9h9OgD+VyGFiaXj3xUDwfLpQTWDP5xmdnDEA0nvGpazRNKNs4O8gvNCUzZc0UON7XcA4GaHLKQ+JMC3fEhokfsC9UB5og5tbdyOjHr0/dGBjG72lErsjaIoNEiD5xzrGlVI3USXOlsgrvQH5fFXWoITzHLsLtAj0TR35rpFm8i1Gu3Eq4HlLNOgHV1AAxu+3atDENbDBu/+EBmjq6V8Ke1CquZzvP6DM7bfNPza/mL83T/AWHPZ1dPYi4zqOZkD4Nsav5NIpYugFBSpYjTsh99dvhItZN3l8CaFjRANvnWYjdkY0DywaxsqVpRNWX94qCiwgxjVtGloQydvSNGcbiVkZAI4qdRUC9T8P6cgoWlC2F97lj86HpZzfJ0bj0Dksgm1n0m7V5Hu5ytnu7hgoi8USg3fMEmid+6gKWrkDrA90UCA4hweGgS4hVcwSJG3JFPKuP+ga28YMvhlUwFV5NYhq92FB3HHVp8KO/9L20QSU7zR4DwIzadCB4NjDRGPmDxHHEv00umf/qP//gXSXOGWPBP0B8eOYK1iWGmv3tJi/jaUkWw+5bMe5M6I+Z1IZJFt/QhYQlhTtSM19Q80p+MRa2maPvo4TFhQPWF7ld2mB3ttNRB9EFmRT3iNsAlmIA+Y84Qmi1Lemsj53ekq/hfZXL70MqwuX3tZQiGEQ==
PLANET_PASSWORD: AgCaZE0Ndpoe/dGeIBWNwrMnCzM2K9mVqivRX3QI/LeRrE48NlGDOOF5gMgkN/0HnP2ov5lv/UUXPl5dDfWOgNQYpEgKaZMuiZTA5h50Mh7P4IyEDMYOb+ccZHBZcL7ezXKveff/m4HIRFEkznIY/jZ4Lkhrx9iKYFzSS8yGyZRVXRF9+Z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null
metadata:
creationTimestamp: null
name: planetx-auth
namespace: planetx
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: planetx
name: planetx-srv
labels:
app: planetx-srv
spec:
replicas: 2
selector:
matchLabels:
app: planetx-srv
template:
metadata:
labels:
app: planetx-srv
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "kubernetes.io/hostname"
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: planetx-srv
containers:
- name: planetx-srv
image: registry.shaytech.net/pxserver:latest
ports:
- name: web
containerPort: 8000
volumeMounts:
- name: px-cred-volume
mountPath: /usr/src/app/creds.json
subPath: creds.json
volumes:
- name: px-cred-volume
secret:
secretName: planetx-auth
items:
- key: creds.json
path: creds.json
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: planet-clean-sessions
namespace: planetx
spec:
schedule: "0 5 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: planet-clean-session-mysql
image: mariadb:10.5.9
imagePullPolicy: IfNotPresent
command: [ "/bin/bash", "-c", "/usr/bin/mysql -u ${PLANET_USERNAME} -h mariadb.mariadb -p${PLANET_PASSWORD} -e 'DELETE FROM sessions WHERE update_time < now() - interval 7 day;' ${PLANET_DATABASE}" ]
volumeMounts:
- mountPath: /data/backup
name: mysql-backup-restore
env:
- name: PLANET_USERNAME
valueFrom:
secretKeyRef:
name: planetx-auth
key: PLANET_USERNAME
- name: PLANET_PASSWORD
valueFrom:
secretKeyRef:
name: planetx-auth
key: PLANET_PASSWORD
- name: PLANET_DATABASE
valueFrom:
secretKeyRef:
name: planetx-auth
key: PLANET_DATABASE
volumes:
- name: mysql-backup-restore
hostPath:
path: /data/sdata/dbbackups/mariadb/am
type: Directory
restartPolicy: OnFailure
---
apiVersion: v1
kind: ConfigMap
metadata:
name: pxweb-conf
namespace: planetx
data:
default.conf: |
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location = /50x.html {
root /usr/share/nginx/html;
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: planetx-web
namespace: planetx
spec:
selector:
matchLabels:
app: planetx-web
replicas: 1
template:
metadata:
labels:
app: planetx-web
annotations:
fluentbit.io/parser: 'nginx'
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html
name: webroot
- mountPath: /etc/nginx/conf.d
name: webconfig
volumes:
- name: webroot
hostPath:
path: /data/sdata/otherwebapps/searchx/planetx
type: Directory
- name: webconfig
configMap:
name: pxweb-conf
items:
- key: default.conf
path: default.conf
---
apiVersion: v1
kind: Service
metadata:
name: planetx-web
namespace: planetx
spec:
ports:
- port: 80
targetPort: 80
selector:
app: planetx-web
---
apiVersion: v1
kind: Service
metadata:
name: planetx-srv
namespace: planetx
spec:
ports:
- port: 80
targetPort: 8000
selector:
app: planetx-srv
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: pushpin
name: planetx-srv-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/limit-connections: "10"
nginx.ingress.kubernetes.io/limit-rpm: "60"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecRequestBodyAccess On
SecAuditEngine RelevantOnly
SecAuditLogParts ABIJDEFHZ
SecAuditLog /var/log/modsec_audit.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
spec:
tls:
- hosts:
- planetx.shaytech.net
rules:
- host: planetx.shaytech.net
http:
paths:
- path: /api(/|$)(.*)
pathType: Prefix
backend:
service:
name: pushpin
port:
number: 7999
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: planetx
name: planetx-web-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
# nginx.ingress.kubernetes.io/limit-connections: "10"
# nginx.ingress.kubernetes.io/limit-rpm: "300"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecRequestBodyAccess On
SecAuditEngine RelevantOnly
SecAuditLogParts ABIJDEFHZ
SecAuditLog /var/log/modsec_audit.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
spec:
tls:
- hosts:
- planetx.shaytech.net
rules:
- host: planetx.shaytech.net
http:
paths:
- path: /
# - path: /
pathType: Prefix
backend:
service:
name: planetx-web
port:
number: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: octopusx-web
namespace: planetx
spec:
selector:
matchLabels:
app: octopusx-web
replicas: 1
template:
metadata:
labels:
app: octopusx-web
annotations:
fluentbit.io/parser: 'nginx'
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html
name: webroot
- mountPath: /etc/nginx/conf.d
name: webconfig
volumes:
- name: webroot
hostPath:
path: /data/sdata/otherwebapps/searchx/octopusx
type: Directory
- name: webconfig
configMap:
name: pxweb-conf
items:
- key: default.conf
path: default.conf
---
apiVersion: v1
kind: Service
metadata:
name: octopusx-web
namespace: planetx
spec:
ports:
- port: 80
targetPort: 80
selector:
app: octopusx-web
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: planetx
name: octopusx-web-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
# nginx.ingress.kubernetes.io/limit-connections: "10"
# nginx.ingress.kubernetes.io/limit-rpm: "300"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecRequestBodyAccess On
SecAuditEngine RelevantOnly
SecAuditLogParts ABIJDEFHZ
SecAuditLog /var/log/modsec_audit.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
spec:
tls:
- hosts:
- octopusx.shaytech.net
rules:
- host: octopusx.shaytech.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: octopusx-web
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: pushpin
name: octopusx-srv-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/limit-connections: "10"
nginx.ingress.kubernetes.io/limit-rpm: "60"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecRequestBodyAccess On
SecAuditEngine RelevantOnly
SecAuditLogParts ABIJDEFHZ
SecAuditLog /var/log/modsec_audit.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
spec:
tls:
- hosts:
- octopusx.shaytech.net
rules:
- host: octopusx.shaytech.net
http:
paths:
- path: /api(/|$)(.*)
pathType: Prefix
backend:
service:
name: pushpin
port:
number: 7999
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: castlex-web
namespace: planetx
spec:
selector:
matchLabels:
app: castlex-web
replicas: 1
template:
metadata:
labels:
app: castlex-web
annotations:
fluentbit.io/parser: 'nginx'
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html
name: webroot
- mountPath: /etc/nginx/conf.d
name: webconfig
volumes:
- name: webroot
hostPath:
path: /data/sdata/otherwebapps/searchx/castlex
type: Directory
- name: webconfig
configMap:
name: pxweb-conf
items:
- key: default.conf
path: default.conf
---
apiVersion: v1
kind: Service
metadata:
name: castlex-web
namespace: planetx
spec:
ports:
- port: 80
targetPort: 80
selector:
app: castlex-web
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: planetx
name: castlex-web-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
# nginx.ingress.kubernetes.io/limit-connections: "10"
# nginx.ingress.kubernetes.io/limit-rpm: "300"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecRequestBodyAccess On
SecAuditEngine RelevantOnly
SecAuditLogParts ABIJDEFHZ
SecAuditLog /var/log/modsec_audit.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
spec:
tls:
- hosts:
- castlex.shaytech.net
rules:
- host: castlex.shaytech.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: castlex-web
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: pushpin
name: castlex-srv-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/limit-connections: "10"
nginx.ingress.kubernetes.io/limit-rpm: "60"
nginx.ingress.kubernetes.io/modsecurity-snippet: |
SecRuleEngine On
SecRequestBodyAccess On
SecAuditEngine RelevantOnly
SecAuditLogParts ABIJDEFHZ
SecAuditLog /var/log/modsec_audit.log
Include /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf
spec:
tls:
- hosts:
- castlex.shaytech.net
rules:
- host: castlex.shaytech.net
http:
paths:
- path: /api(/|$)(.*)
pathType: Prefix
backend:
service:
name: pushpin
port:
number: 7999