cyberia 3.2.9 → 3.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/engine-cyberia.cd.yml +7 -0
- package/.github/workflows/engine-cyberia.ci.yml +14 -2
- package/.github/workflows/ghpkg.ci.yml +1 -0
- package/.github/workflows/npmpkg.ci.yml +10 -5
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.github/workflows/release.cd.yml +1 -0
- package/.vscode/extensions.json +9 -9
- package/.vscode/settings.json +20 -4
- package/CHANGELOG.md +363 -1
- package/CLI-HELP.md +975 -1061
- package/README.md +190 -348
- package/bin/build.js +102 -125
- package/bin/build.template.js +33 -0
- package/bin/cyberia.js +238 -56
- package/bin/deploy.js +16 -3
- package/bin/index.js +238 -56
- package/bump.config.js +26 -0
- package/conf.js +131 -24
- package/deployment.yaml +76 -2
- package/hardhat/package-lock.json +113 -144
- package/hardhat/package.json +4 -3
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +2 -2
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
- package/manifests/deployment/dd-cyberia-development/deployment.yaml +76 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/kind-config-dev.yaml +8 -0
- package/manifests/lxd/lxd-admin-profile.yaml +12 -3
- package/manifests/mongodb/pv-pvc.yaml +44 -8
- package/manifests/mongodb/statefulset.yaml +55 -68
- package/manifests/mongodb-4.4/headless-service.yaml +10 -0
- package/manifests/mongodb-4.4/kustomization.yaml +3 -1
- package/manifests/mongodb-4.4/mongodb-nodeport.yaml +17 -0
- package/manifests/mongodb-4.4/pv-pvc.yaml +10 -14
- package/manifests/mongodb-4.4/statefulset.yaml +79 -0
- package/manifests/mongodb-4.4/storage-class.yaml +9 -0
- package/manifests/valkey/statefulset.yaml +1 -1
- package/manifests/valkey/valkey-nodeport.yaml +17 -0
- package/package.json +31 -19
- package/scripts/ipxe-setup.sh +52 -49
- package/scripts/k3s-node-setup.sh +81 -46
- package/scripts/link-local-underpost-cli.sh +6 -0
- package/scripts/lxd-vm-setup.sh +193 -8
- package/scripts/maas-nat-firewalld.sh +145 -0
- package/scripts/test-monitor.sh +250 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +38 -33
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +16 -16
- package/src/api/core/core.router.js +19 -14
- package/src/api/core/core.service.js +5 -5
- package/src/api/crypto/crypto.router.js +18 -12
- package/src/api/crypto/crypto.service.js +3 -3
- package/src/api/cyberia-action/cyberia-action.model.js +1 -1
- package/src/api/cyberia-action/cyberia-action.router.js +22 -18
- package/src/api/cyberia-action/cyberia-action.service.js +5 -5
- package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +74 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +99 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +98 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +152 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +25 -20
- package/src/api/cyberia-dialogue/cyberia-dialogue.service.js +6 -6
- package/src/api/cyberia-entity/cyberia-entity.router.js +22 -18
- package/src/api/cyberia-entity/cyberia-entity.service.js +5 -5
- package/src/api/cyberia-instance/cyberia-fallback-world.js +79 -4
- package/src/api/cyberia-instance/cyberia-instance.router.js +57 -52
- package/src/api/cyberia-instance/cyberia-instance.service.js +10 -10
- package/src/api/cyberia-instance/cyberia-world-generator.js +3 -3
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +14 -48
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.router.js +22 -18
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +5 -5
- package/src/api/cyberia-map/cyberia-map.router.js +35 -30
- package/src/api/cyberia-map/cyberia-map.service.js +7 -7
- package/src/api/cyberia-quest/cyberia-quest.model.js +1 -1
- package/src/api/cyberia-quest/cyberia-quest.router.js +22 -18
- package/src/api/cyberia-quest/cyberia-quest.service.js +5 -5
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.router.js +22 -18
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.service.js +5 -5
- package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +458 -0
- package/src/api/default/default.router.js +22 -18
- package/src/api/default/default.service.js +5 -5
- package/src/api/document/document.router.js +28 -23
- package/src/api/document/document.service.js +100 -23
- package/src/api/file/file.router.js +19 -13
- package/src/api/file/file.service.js +9 -7
- package/src/api/instance/instance.router.js +29 -24
- package/src/api/instance/instance.service.js +6 -6
- package/src/api/ipfs/ipfs.router.js +21 -16
- package/src/api/ipfs/ipfs.service.js +8 -8
- package/src/api/object-layer/object-layer.router.js +512 -507
- package/src/api/object-layer/object-layer.service.js +17 -14
- package/src/api/object-layer-render-frames/object-layer-render-frames.router.js +22 -18
- package/src/api/object-layer-render-frames/object-layer-render-frames.service.js +5 -5
- package/src/api/test/test.router.js +17 -12
- package/src/api/types.js +24 -0
- package/src/api/user/guest.service.js +5 -4
- package/src/api/user/user.router.js +297 -288
- package/src/api/user/user.service.js +100 -35
- package/src/cli/baremetal.js +132 -101
- package/src/cli/cluster.js +700 -232
- package/src/cli/db.js +59 -60
- package/src/cli/deploy.js +291 -294
- package/src/cli/env.js +1 -4
- package/src/cli/fs.js +13 -3
- package/src/cli/image.js +58 -4
- package/src/cli/index.js +127 -15
- package/src/cli/ipfs.js +4 -6
- package/src/cli/kubectl.js +4 -1
- package/src/cli/lxd.js +1099 -223
- package/src/cli/monitor.js +396 -9
- package/src/cli/release.js +355 -146
- package/src/cli/repository.js +169 -30
- package/src/cli/run.js +347 -117
- package/src/cli/secrets.js +11 -2
- package/src/cli/test.js +9 -3
- package/src/client/Default.index.js +9 -3
- package/src/client/components/core/Auth.js +5 -0
- package/src/client/components/core/ClientEvents.js +76 -0
- package/src/client/components/core/EventBus.js +4 -0
- package/src/client/components/core/Modal.js +82 -41
- package/src/client/components/core/PanelForm.js +14 -10
- package/src/client/components/core/Worker.js +162 -363
- package/src/client/components/cyberia/MapEngineCyberia.js +1 -1
- package/src/client/components/cyberia/SharedDefaultsCyberia.js +330 -0
- package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +55 -1
- package/src/client/public/cyberia-docs/ARCHITECTURE.md +223 -361
- package/src/client/public/cyberia-docs/CYBERIA-CLI.md +114 -327
- package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +200 -222
- package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +212 -185
- package/src/client/public/cyberia-docs/CYBERIA.md +259 -0
- package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +2 -2
- package/src/client/public/cyberia-docs/QUEST-SYSTEM.md +23 -1
- package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
- package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +106 -0
- package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
- package/src/client/services/cyberia-client-hints/cyberia-client-hints.service.js +99 -0
- package/src/client/ssr/views/CyberiaServerMetrics.js +982 -0
- package/src/client/sw/core.sw.js +174 -112
- package/src/db/DataBaseProvider.js +115 -15
- package/src/db/mariadb/MariaDB.js +2 -1
- package/src/db/mongo/MongoBootstrap.js +657 -0
- package/src/db/mongo/MongooseDB.js +130 -21
- package/src/grpc/cyberia/grpc-server.js +25 -57
- package/src/index.js +1 -1
- package/src/runtime/cyberia-client/Dockerfile +10 -7
- package/src/runtime/cyberia-client/Dockerfile.dev +67 -0
- package/src/runtime/cyberia-server/Dockerfile +11 -6
- package/src/runtime/cyberia-server/Dockerfile.dev +47 -0
- package/src/runtime/express/Express.js +2 -2
- package/src/runtime/wp/Dockerfile +3 -3
- package/src/runtime/wp/Wp.js +8 -5
- package/src/server/auth.js +2 -2
- package/src/server/catalog-underpost.js +61 -0
- package/src/server/catalog.js +77 -0
- package/src/server/client-build-docs.js +1 -1
- package/src/server/client-build.js +94 -129
- package/src/server/conf.js +496 -135
- package/src/server/ipfs-client.js +5 -3
- package/src/server/process.js +180 -19
- package/src/server/proxy.js +9 -2
- package/src/server/runtime-status.js +235 -0
- package/src/server/runtime.js +1 -1
- package/src/server/start.js +44 -11
- package/src/server/valkey.js +2 -0
- package/src/ws/IoInterface.js +16 -16
- package/src/ws/core/channels/core.ws.chat.js +11 -11
- package/src/ws/core/channels/core.ws.mailer.js +29 -29
- package/src/ws/core/channels/core.ws.stream.js +19 -19
- package/src/ws/core/core.ws.connection.js +8 -8
- package/src/ws/core/core.ws.server.js +6 -5
- package/src/ws/default/channels/default.ws.main.js +10 -10
- package/src/ws/default/default.ws.connection.js +4 -4
- package/src/ws/default/default.ws.server.js +4 -3
- package/test/deploy-monitor.test.js +251 -0
- package/bin/file.js +0 -202
- package/bin/vs.js +0 -74
- package/bin/zed.js +0 -84
- package/manifests/deployment/dd-test-development/deployment.yaml +0 -254
- package/manifests/deployment/dd-test-development/proxy.yaml +0 -102
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.defaults.js +0 -574
- package/src/client/components/cyberia-portal/CommonCyberiaPortal.js +0 -467
- package/src/client/ssr/email/DefaultRecoverEmail.js +0 -21
- package/src/client/ssr/email/DefaultVerifyEmail.js +0 -17
- package/src/client/ssr/pages/CyberiaServerMetrics.js +0 -461
- /package/src/client/ssr/{offline → views}/Maintenance.js +0 -0
- /package/src/client/ssr/{offline → views}/NoNetworkConnection.js +0 -0
- /package/src/client/ssr/{pages → views}/Test.js +0 -0
|
@@ -20,11 +20,14 @@ spec:
|
|
|
20
20
|
spec:
|
|
21
21
|
containers:
|
|
22
22
|
- name: dd-cyberia-development-blue
|
|
23
|
-
image: underpost/underpost-engine:v3.2.
|
|
23
|
+
image: underpost/underpost-engine:v3.2.22
|
|
24
24
|
imagePullPolicy: IfNotPresent
|
|
25
25
|
envFrom:
|
|
26
26
|
- secretRef:
|
|
27
27
|
name: underpost-config
|
|
28
|
+
env:
|
|
29
|
+
- name: UNDERPOST_INTERNAL_PORT
|
|
30
|
+
value: "4004"
|
|
28
31
|
|
|
29
32
|
command:
|
|
30
33
|
- /bin/sh
|
|
@@ -32,6 +35,40 @@ spec:
|
|
|
32
35
|
- >
|
|
33
36
|
underpost secret underpost --create-from-env &&
|
|
34
37
|
underpost start --build --run dd-cyberia development
|
|
38
|
+
readinessProbe:
|
|
39
|
+
{
|
|
40
|
+
"httpGet": {
|
|
41
|
+
"path": "/_internal/ready",
|
|
42
|
+
"port": 4004
|
|
43
|
+
},
|
|
44
|
+
"initialDelaySeconds": 5,
|
|
45
|
+
"periodSeconds": 5,
|
|
46
|
+
"timeoutSeconds": 3,
|
|
47
|
+
"failureThreshold": 3
|
|
48
|
+
}
|
|
49
|
+
livenessProbe:
|
|
50
|
+
{
|
|
51
|
+
"httpGet": {
|
|
52
|
+
"path": "/_internal/health",
|
|
53
|
+
"port": 4004
|
|
54
|
+
},
|
|
55
|
+
"initialDelaySeconds": 30,
|
|
56
|
+
"periodSeconds": 15,
|
|
57
|
+
"timeoutSeconds": 3,
|
|
58
|
+
"failureThreshold": 3
|
|
59
|
+
}
|
|
60
|
+
startupProbe:
|
|
61
|
+
{
|
|
62
|
+
"httpGet": {
|
|
63
|
+
"path": "/_internal/ready",
|
|
64
|
+
"port": 4004
|
|
65
|
+
},
|
|
66
|
+
"initialDelaySeconds": 10,
|
|
67
|
+
"periodSeconds": 10,
|
|
68
|
+
"timeoutSeconds": 3,
|
|
69
|
+
"failureThreshold": 180
|
|
70
|
+
}
|
|
71
|
+
|
|
35
72
|
|
|
36
73
|
|
|
37
74
|
volumeMounts:
|
|
@@ -192,11 +229,14 @@ spec:
|
|
|
192
229
|
spec:
|
|
193
230
|
containers:
|
|
194
231
|
- name: dd-cyberia-development-green
|
|
195
|
-
image: underpost/underpost-engine:v3.2.
|
|
232
|
+
image: underpost/underpost-engine:v3.2.22
|
|
196
233
|
imagePullPolicy: IfNotPresent
|
|
197
234
|
envFrom:
|
|
198
235
|
- secretRef:
|
|
199
236
|
name: underpost-config
|
|
237
|
+
env:
|
|
238
|
+
- name: UNDERPOST_INTERNAL_PORT
|
|
239
|
+
value: "4004"
|
|
200
240
|
|
|
201
241
|
command:
|
|
202
242
|
- /bin/sh
|
|
@@ -204,6 +244,40 @@ spec:
|
|
|
204
244
|
- >
|
|
205
245
|
underpost secret underpost --create-from-env &&
|
|
206
246
|
underpost start --build --run dd-cyberia development
|
|
247
|
+
readinessProbe:
|
|
248
|
+
{
|
|
249
|
+
"httpGet": {
|
|
250
|
+
"path": "/_internal/ready",
|
|
251
|
+
"port": 4004
|
|
252
|
+
},
|
|
253
|
+
"initialDelaySeconds": 5,
|
|
254
|
+
"periodSeconds": 5,
|
|
255
|
+
"timeoutSeconds": 3,
|
|
256
|
+
"failureThreshold": 3
|
|
257
|
+
}
|
|
258
|
+
livenessProbe:
|
|
259
|
+
{
|
|
260
|
+
"httpGet": {
|
|
261
|
+
"path": "/_internal/health",
|
|
262
|
+
"port": 4004
|
|
263
|
+
},
|
|
264
|
+
"initialDelaySeconds": 30,
|
|
265
|
+
"periodSeconds": 15,
|
|
266
|
+
"timeoutSeconds": 3,
|
|
267
|
+
"failureThreshold": 3
|
|
268
|
+
}
|
|
269
|
+
startupProbe:
|
|
270
|
+
{
|
|
271
|
+
"httpGet": {
|
|
272
|
+
"path": "/_internal/ready",
|
|
273
|
+
"port": 4004
|
|
274
|
+
},
|
|
275
|
+
"initialDelaySeconds": 10,
|
|
276
|
+
"periodSeconds": 10,
|
|
277
|
+
"timeoutSeconds": 3,
|
|
278
|
+
"failureThreshold": 180
|
|
279
|
+
}
|
|
280
|
+
|
|
207
281
|
|
|
208
282
|
|
|
209
283
|
volumeMounts:
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: underpost/underpost-engine:v3.2.
|
|
20
|
+
image: underpost/underpost-engine:v3.2.22
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -98,7 +98,7 @@ spec:
|
|
|
98
98
|
spec:
|
|
99
99
|
containers:
|
|
100
100
|
- name: dd-default-development-green
|
|
101
|
-
image: underpost/underpost-engine:v3.2.
|
|
101
|
+
image: underpost/underpost-engine:v3.2.22
|
|
102
102
|
# resources:
|
|
103
103
|
# requests:
|
|
104
104
|
# memory: "124Ki"
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
kind: Cluster
|
|
2
2
|
apiVersion: kind.x-k8s.io/v1alpha4
|
|
3
|
+
networking:
|
|
4
|
+
ipFamily: ipv4
|
|
3
5
|
nodes:
|
|
4
6
|
- role: control-plane
|
|
7
|
+
extraMounts:
|
|
8
|
+
- hostPath: /data/mongodb
|
|
9
|
+
containerPath: /data/mongodb
|
|
5
10
|
- role: worker
|
|
11
|
+
extraMounts:
|
|
12
|
+
- hostPath: /data/mongodb
|
|
13
|
+
containerPath: /data/mongodb
|
|
6
14
|
# extraPortMappings:
|
|
7
15
|
# - containerPort: 80
|
|
8
16
|
# hostPort: 80
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
config:
|
|
2
|
-
limits.cpu:
|
|
2
|
+
limits.cpu: '2'
|
|
3
3
|
limits.memory: 4GB
|
|
4
|
-
|
|
4
|
+
# Host-safety hardening:
|
|
5
|
+
# boot.autostart=false → the LXD daemon will NOT start any VM created with
|
|
6
|
+
# this profile when the host boots. The user explicitly brings VMs up
|
|
7
|
+
# after the host is verified healthy. Prevents a broken VM from blocking
|
|
8
|
+
# boot via snap.lxd.daemon.
|
|
9
|
+
# boot.host_shutdown_timeout=60 → bound the time the daemon waits for this
|
|
10
|
+
# VM to stop when the host is going down. Prevents an unresponsive VM
|
|
11
|
+
# from holding the host in an indefinite shutdown.
|
|
12
|
+
boot.autostart: 'false'
|
|
13
|
+
boot.host_shutdown_timeout: '60'
|
|
14
|
+
description: vm nat network (host-safe defaults)
|
|
5
15
|
devices:
|
|
6
16
|
eth0:
|
|
7
17
|
name: eth0
|
|
8
18
|
network: lxdbr0
|
|
9
19
|
type: nic
|
|
10
|
-
ipv4.address: 10.250.250.100
|
|
11
20
|
root:
|
|
12
21
|
path: /
|
|
13
22
|
pool: local # lxc storage list
|
|
@@ -1,23 +1,59 @@
|
|
|
1
1
|
apiVersion: v1
|
|
2
2
|
kind: PersistentVolume
|
|
3
3
|
metadata:
|
|
4
|
-
name: mongodb-pv
|
|
4
|
+
name: mongodb-pv-0
|
|
5
|
+
labels:
|
|
6
|
+
app: mongodb
|
|
5
7
|
spec:
|
|
6
8
|
capacity:
|
|
7
9
|
storage: 5Gi
|
|
8
10
|
accessModes:
|
|
9
11
|
- ReadWriteOnce
|
|
12
|
+
persistentVolumeReclaimPolicy: Retain
|
|
13
|
+
storageClassName: mongodb-storage-class
|
|
14
|
+
claimRef:
|
|
15
|
+
namespace: default
|
|
16
|
+
name: mongodb-storage-mongodb-0
|
|
10
17
|
hostPath:
|
|
11
|
-
path: /data/mongodb
|
|
18
|
+
path: /data/mongodb/v0
|
|
19
|
+
type: DirectoryOrCreate
|
|
12
20
|
---
|
|
13
21
|
apiVersion: v1
|
|
14
|
-
kind:
|
|
22
|
+
kind: PersistentVolume
|
|
23
|
+
metadata:
|
|
24
|
+
name: mongodb-pv-1
|
|
25
|
+
labels:
|
|
26
|
+
app: mongodb
|
|
27
|
+
spec:
|
|
28
|
+
capacity:
|
|
29
|
+
storage: 5Gi
|
|
30
|
+
accessModes:
|
|
31
|
+
- ReadWriteOnce
|
|
32
|
+
persistentVolumeReclaimPolicy: Retain
|
|
33
|
+
storageClassName: mongodb-storage-class
|
|
34
|
+
claimRef:
|
|
35
|
+
namespace: default
|
|
36
|
+
name: mongodb-storage-mongodb-1
|
|
37
|
+
hostPath:
|
|
38
|
+
path: /data/mongodb/v1
|
|
39
|
+
type: DirectoryOrCreate
|
|
40
|
+
---
|
|
41
|
+
apiVersion: v1
|
|
42
|
+
kind: PersistentVolume
|
|
15
43
|
metadata:
|
|
16
|
-
name: mongodb-
|
|
44
|
+
name: mongodb-pv-2
|
|
45
|
+
labels:
|
|
46
|
+
app: mongodb
|
|
17
47
|
spec:
|
|
18
|
-
|
|
48
|
+
capacity:
|
|
49
|
+
storage: 5Gi
|
|
19
50
|
accessModes:
|
|
20
51
|
- ReadWriteOnce
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
52
|
+
persistentVolumeReclaimPolicy: Retain
|
|
53
|
+
storageClassName: mongodb-storage-class
|
|
54
|
+
claimRef:
|
|
55
|
+
namespace: default
|
|
56
|
+
name: mongodb-storage-mongodb-2
|
|
57
|
+
hostPath:
|
|
58
|
+
path: /data/mongodb/v2
|
|
59
|
+
type: DirectoryOrCreate
|
|
@@ -4,7 +4,8 @@ metadata:
|
|
|
4
4
|
name: mongodb # Specifies the name of the statefulset
|
|
5
5
|
spec:
|
|
6
6
|
serviceName: 'mongodb-service' # Specifies the service to use
|
|
7
|
-
|
|
7
|
+
podManagementPolicy: OrderedReady # or Parallel
|
|
8
|
+
replicas: 3
|
|
8
9
|
selector:
|
|
9
10
|
matchLabels:
|
|
10
11
|
app: mongodb
|
|
@@ -13,80 +14,58 @@ spec:
|
|
|
13
14
|
labels:
|
|
14
15
|
app: mongodb
|
|
15
16
|
spec:
|
|
17
|
+
subdomain: mongodb-service
|
|
18
|
+
securityContext:
|
|
19
|
+
fsGroup: 999
|
|
20
|
+
initContainers:
|
|
21
|
+
- name: internal-keyfile-provisioner
|
|
22
|
+
image: docker.io/library/mongo:latest
|
|
23
|
+
securityContext:
|
|
24
|
+
runAsUser: 0
|
|
25
|
+
runAsGroup: 0
|
|
26
|
+
command:
|
|
27
|
+
- sh
|
|
28
|
+
- -c
|
|
29
|
+
- |
|
|
30
|
+
set -ex
|
|
31
|
+
mkdir -p /opt/mongodb
|
|
32
|
+
cp /tmp/raw-keyfile/mongodb-keyfile /opt/mongodb/mongodb-keyfile
|
|
33
|
+
chmod 400 /opt/mongodb/mongodb-keyfile
|
|
34
|
+
chown -R 999:999 /opt/mongodb
|
|
35
|
+
chown -R 999:999 /data/db
|
|
36
|
+
rm -f /data/db/mongod.lock
|
|
37
|
+
volumeMounts:
|
|
38
|
+
- name: raw-secret-keyfile-volume
|
|
39
|
+
mountPath: /tmp/raw-keyfile
|
|
40
|
+
- name: isolated-runtime-keyfile-volume
|
|
41
|
+
mountPath: /opt/mongodb
|
|
42
|
+
- name: mongodb-storage
|
|
43
|
+
mountPath: /data/db
|
|
16
44
|
containers:
|
|
17
45
|
- name: mongodb
|
|
18
46
|
image: docker.io/library/mongo:latest
|
|
19
47
|
command:
|
|
20
48
|
- mongod
|
|
49
|
+
args:
|
|
21
50
|
- '--replSet'
|
|
22
51
|
- 'rs0'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# - 'keyFile'
|
|
29
|
-
# - '--keyFile'
|
|
30
|
-
# - '/etc/mongodb-keyfile'
|
|
31
|
-
# - '--interleave'
|
|
32
|
-
# - 'all'
|
|
33
|
-
# - '--wiredTigerCacheSizeGB'
|
|
34
|
-
# - '0.25'
|
|
35
|
-
# - '--setParameter'
|
|
36
|
-
# - 'authenticationMechanisms=SCRAM-SHA-1'
|
|
37
|
-
# - '--fork'
|
|
38
|
-
- '--logpath'
|
|
39
|
-
- '/var/log/mongodb/mongod.log'
|
|
52
|
+
- '--auth'
|
|
53
|
+
- '--clusterAuthMode'
|
|
54
|
+
- 'keyFile'
|
|
55
|
+
- '--keyFile'
|
|
56
|
+
- '/opt/mongodb/mongodb-keyfile'
|
|
40
57
|
- '--bind_ip_all'
|
|
41
|
-
|
|
42
|
-
# args:
|
|
43
|
-
# - |
|
|
44
|
-
# mongod --replSet rs0 --bind_ip_all &
|
|
45
|
-
# sleep 1000
|
|
46
|
-
# if mongosh --host mongodb-0.mongodb-service:27017 --eval "rs.status()" | grep -q "not yet initialized"; then
|
|
47
|
-
# mongosh --host mongodb-0.mongodb-service:27017 <<EOF
|
|
48
|
-
# use admin;
|
|
49
|
-
# rs.initiate({
|
|
50
|
-
# _id: "rs0",
|
|
51
|
-
# members: [
|
|
52
|
-
# { _id: 0, host: "mongodb-0.mongodb-service:27017", priority: 1 },
|
|
53
|
-
# { _id: 1, host: "mongodb-1.mongodb-service:27017", priority: 1 }
|
|
54
|
-
# ]
|
|
55
|
-
# });
|
|
56
|
-
# db.getSiblingDB("admin").createUser({
|
|
57
|
-
# user: process.env.MONGO_INITDB_ROOT_USERNAME,
|
|
58
|
-
# pwd: process.env.MONGO_INITDB_ROOT_PASSWORD,
|
|
59
|
-
# roles: [{ role: "userAdminAnyDatabase", db: "admin" }]
|
|
60
|
-
# });
|
|
61
|
-
# use default;
|
|
62
|
-
# db.createUser(
|
|
63
|
-
# {
|
|
64
|
-
# user: process.env.MONGO_INITDB_ROOT_USERNAME,
|
|
65
|
-
# pwd: process.env.MONGO_INITDB_ROOT_PASSWORD,
|
|
66
|
-
# roles: [
|
|
67
|
-
# { role: "read", db: "test" },
|
|
68
|
-
# { role: "readWrite", db: "default" }
|
|
69
|
-
# ]
|
|
70
|
-
# }
|
|
71
|
-
# );
|
|
72
|
-
# EOF
|
|
73
|
-
# fi
|
|
74
|
-
# wait
|
|
58
|
+
|
|
75
59
|
ports:
|
|
76
60
|
- containerPort: 27017
|
|
77
61
|
volumeMounts:
|
|
62
|
+
- name: isolated-runtime-keyfile-volume
|
|
63
|
+
mountPath: /opt/mongodb
|
|
78
64
|
- name: mongodb-storage
|
|
79
65
|
mountPath: /data/db
|
|
80
|
-
- name: keyfile
|
|
81
|
-
mountPath: /etc/mongodb-keyfile
|
|
82
|
-
readOnly: true
|
|
83
|
-
# - name: mongodb-configuration-file
|
|
84
|
-
# mountPath: /etc/mongod.conf
|
|
85
|
-
# subPath: mongod.conf
|
|
86
|
-
# readOnly: true
|
|
87
|
-
# - name: mongodb-config
|
|
88
|
-
# mountPath: /config
|
|
89
66
|
env:
|
|
67
|
+
- name: MONGO_REPLICA_SET_NAME
|
|
68
|
+
value: rs0
|
|
90
69
|
- name: MONGO_INITDB_ROOT_USERNAME
|
|
91
70
|
valueFrom:
|
|
92
71
|
secretKeyRef:
|
|
@@ -97,6 +76,18 @@ spec:
|
|
|
97
76
|
secretKeyRef:
|
|
98
77
|
name: mongodb-secret
|
|
99
78
|
key: password
|
|
79
|
+
readinessProbe:
|
|
80
|
+
tcpSocket:
|
|
81
|
+
port: 27017
|
|
82
|
+
initialDelaySeconds: 15
|
|
83
|
+
periodSeconds: 10
|
|
84
|
+
timeoutSeconds: 5
|
|
85
|
+
livenessProbe:
|
|
86
|
+
tcpSocket:
|
|
87
|
+
port: 27017
|
|
88
|
+
initialDelaySeconds: 30
|
|
89
|
+
periodSeconds: 20
|
|
90
|
+
timeoutSeconds: 5
|
|
100
91
|
resources:
|
|
101
92
|
requests:
|
|
102
93
|
cpu: '100m'
|
|
@@ -105,16 +96,12 @@ spec:
|
|
|
105
96
|
cpu: '500m'
|
|
106
97
|
memory: '512Mi'
|
|
107
98
|
volumes:
|
|
108
|
-
- name: keyfile
|
|
99
|
+
- name: raw-secret-keyfile-volume
|
|
109
100
|
secret:
|
|
110
101
|
secretName: mongodb-keyfile
|
|
111
102
|
defaultMode: 0400
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
# name: mongodb-config-file
|
|
115
|
-
# - name: mongodb-config
|
|
116
|
-
# configMap:
|
|
117
|
-
# name: mongodb-config
|
|
103
|
+
- name: isolated-runtime-keyfile-volume
|
|
104
|
+
emptyDir: {}
|
|
118
105
|
volumeClaimTemplates:
|
|
119
106
|
- metadata:
|
|
120
107
|
name: mongodb-storage
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Service
|
|
3
|
+
metadata:
|
|
4
|
+
name: mongodb-nodeport
|
|
5
|
+
labels:
|
|
6
|
+
app: mongodb
|
|
7
|
+
spec:
|
|
8
|
+
type: NodePort
|
|
9
|
+
externalTrafficPolicy: Cluster
|
|
10
|
+
selector:
|
|
11
|
+
app: mongodb
|
|
12
|
+
ports:
|
|
13
|
+
- name: mongodb
|
|
14
|
+
protocol: TCP
|
|
15
|
+
port: 27017
|
|
16
|
+
targetPort: 27017
|
|
17
|
+
nodePort: 32017
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
apiVersion: v1
|
|
2
2
|
kind: PersistentVolume
|
|
3
3
|
metadata:
|
|
4
|
-
name: mongodb-pv
|
|
4
|
+
name: mongodb-pv-0
|
|
5
|
+
labels:
|
|
6
|
+
app: mongodb
|
|
5
7
|
spec:
|
|
6
8
|
capacity:
|
|
7
9
|
storage: 5Gi
|
|
8
10
|
accessModes:
|
|
9
11
|
- ReadWriteOnce
|
|
12
|
+
persistentVolumeReclaimPolicy: Retain
|
|
13
|
+
storageClassName: mongodb-storage-class
|
|
14
|
+
claimRef:
|
|
15
|
+
namespace: default
|
|
16
|
+
name: mongodb-storage-mongodb-0
|
|
10
17
|
hostPath:
|
|
11
|
-
path: /data/mongodb
|
|
12
|
-
|
|
13
|
-
apiVersion: v1
|
|
14
|
-
kind: PersistentVolumeClaim
|
|
15
|
-
metadata:
|
|
16
|
-
name: mongodb-pvc
|
|
17
|
-
spec:
|
|
18
|
-
storageClassName: ''
|
|
19
|
-
accessModes:
|
|
20
|
-
- ReadWriteOnce
|
|
21
|
-
resources:
|
|
22
|
-
requests:
|
|
23
|
-
storage: 5Gi
|
|
18
|
+
path: /data/mongodb/v0
|
|
19
|
+
type: DirectoryOrCreate
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: StatefulSet
|
|
3
|
+
metadata:
|
|
4
|
+
name: mongodb # Specifies the name of the statefulset
|
|
5
|
+
spec:
|
|
6
|
+
serviceName: 'mongodb-service' # Specifies the service to use
|
|
7
|
+
podManagementPolicy: OrderedReady # or Parallel
|
|
8
|
+
replicas: 1
|
|
9
|
+
selector:
|
|
10
|
+
matchLabels:
|
|
11
|
+
app: mongodb
|
|
12
|
+
template:
|
|
13
|
+
metadata:
|
|
14
|
+
labels:
|
|
15
|
+
app: mongodb
|
|
16
|
+
spec:
|
|
17
|
+
subdomain: mongodb-service
|
|
18
|
+
securityContext:
|
|
19
|
+
fsGroup: 999
|
|
20
|
+
initContainers:
|
|
21
|
+
- name: data-dir-permissions
|
|
22
|
+
image: docker.io/library/mongo:4.4
|
|
23
|
+
securityContext:
|
|
24
|
+
runAsUser: 0
|
|
25
|
+
runAsGroup: 0
|
|
26
|
+
command:
|
|
27
|
+
- sh
|
|
28
|
+
- -c
|
|
29
|
+
- |
|
|
30
|
+
chown -R 999:999 /data/db
|
|
31
|
+
rm -f /data/db/mongod.lock
|
|
32
|
+
volumeMounts:
|
|
33
|
+
- name: mongodb-storage
|
|
34
|
+
mountPath: /data/db
|
|
35
|
+
containers:
|
|
36
|
+
- name: mongodb
|
|
37
|
+
image: docker.io/library/mongo:4.4
|
|
38
|
+
command:
|
|
39
|
+
- mongod
|
|
40
|
+
args:
|
|
41
|
+
- '--replSet'
|
|
42
|
+
- 'rs0'
|
|
43
|
+
- '--bind_ip_all'
|
|
44
|
+
ports:
|
|
45
|
+
- containerPort: 27017
|
|
46
|
+
volumeMounts:
|
|
47
|
+
- name: mongodb-storage
|
|
48
|
+
mountPath: /data/db
|
|
49
|
+
env:
|
|
50
|
+
- name: MONGO_REPLICA_SET_NAME
|
|
51
|
+
value: rs0
|
|
52
|
+
readinessProbe:
|
|
53
|
+
tcpSocket:
|
|
54
|
+
port: 27017
|
|
55
|
+
initialDelaySeconds: 15
|
|
56
|
+
periodSeconds: 10
|
|
57
|
+
timeoutSeconds: 5
|
|
58
|
+
livenessProbe:
|
|
59
|
+
tcpSocket:
|
|
60
|
+
port: 27017
|
|
61
|
+
initialDelaySeconds: 30
|
|
62
|
+
periodSeconds: 20
|
|
63
|
+
timeoutSeconds: 5
|
|
64
|
+
resources:
|
|
65
|
+
requests:
|
|
66
|
+
cpu: '100m'
|
|
67
|
+
memory: '256Mi'
|
|
68
|
+
limits:
|
|
69
|
+
cpu: '500m'
|
|
70
|
+
memory: '512Mi'
|
|
71
|
+
volumeClaimTemplates:
|
|
72
|
+
- metadata:
|
|
73
|
+
name: mongodb-storage
|
|
74
|
+
spec:
|
|
75
|
+
accessModes: ['ReadWriteOnce']
|
|
76
|
+
storageClassName: mongodb-storage-class
|
|
77
|
+
resources:
|
|
78
|
+
requests:
|
|
79
|
+
storage: 5Gi
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
apiVersion: storage.k8s.io/v1
|
|
2
|
+
kind: StorageClass
|
|
3
|
+
metadata:
|
|
4
|
+
name: mongodb-storage-class
|
|
5
|
+
annotations:
|
|
6
|
+
storageclass.kubernetes.io/is-default-class: 'false'
|
|
7
|
+
provisioner: rancher.io/local-path
|
|
8
|
+
reclaimPolicy: Retain
|
|
9
|
+
volumeBindingMode: WaitForFirstConsumer
|
|
@@ -19,7 +19,7 @@ spec:
|
|
|
19
19
|
image: docker.io/valkey/valkey:latest
|
|
20
20
|
imagePullPolicy: IfNotPresent
|
|
21
21
|
command: ['valkey-server']
|
|
22
|
-
args: ['--port', '6379']
|
|
22
|
+
args: ['--port', '6379', '--bind', '0.0.0.0', '--protected-mode', 'no']
|
|
23
23
|
ports:
|
|
24
24
|
- containerPort: 6379
|
|
25
25
|
startupProbe:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Service
|
|
3
|
+
metadata:
|
|
4
|
+
name: valkey-nodeport
|
|
5
|
+
labels:
|
|
6
|
+
app: valkey-service
|
|
7
|
+
spec:
|
|
8
|
+
type: NodePort
|
|
9
|
+
externalTrafficPolicy: Cluster
|
|
10
|
+
selector:
|
|
11
|
+
app: valkey-service
|
|
12
|
+
ports:
|
|
13
|
+
- name: valkey
|
|
14
|
+
protocol: TCP
|
|
15
|
+
port: 6379
|
|
16
|
+
targetPort: 6379
|
|
17
|
+
nodePort: 32079
|