underpost 2.8.1 → 2.8.7

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.
Files changed (145) hide show
  1. package/.dockerignore +1 -0
  2. package/.github/workflows/ghpkg.yml +19 -49
  3. package/.github/workflows/npmpkg.yml +67 -0
  4. package/.github/workflows/publish.yml +5 -5
  5. package/.github/workflows/pwa-microservices-template.page.yml +12 -4
  6. package/.github/workflows/pwa-microservices-template.test.yml +2 -2
  7. package/.vscode/extensions.json +18 -71
  8. package/.vscode/settings.json +20 -3
  9. package/AUTHORS.md +16 -5
  10. package/CHANGELOG.md +123 -3
  11. package/Dockerfile +27 -70
  12. package/README.md +39 -29
  13. package/bin/build.js +186 -0
  14. package/bin/db.js +2 -24
  15. package/bin/deploy.js +1467 -236
  16. package/bin/file.js +67 -16
  17. package/bin/hwt.js +0 -10
  18. package/bin/index.js +1 -77
  19. package/bin/ssl.js +19 -11
  20. package/bin/util.js +9 -104
  21. package/bin/vs.js +26 -2
  22. package/cli.md +451 -0
  23. package/conf.js +29 -138
  24. package/docker-compose.yml +1 -1
  25. package/jsdoc.json +1 -1
  26. package/manifests/calico-custom-resources.yaml +25 -0
  27. package/manifests/deployment/adminer/deployment.yaml +32 -0
  28. package/manifests/deployment/adminer/kustomization.yaml +7 -0
  29. package/manifests/deployment/adminer/service.yaml +13 -0
  30. package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
  31. package/manifests/deployment/fastapi/backend-service.yml +19 -0
  32. package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
  33. package/manifests/deployment/fastapi/frontend-service.yml +15 -0
  34. package/manifests/deployment/kafka/deployment.yaml +69 -0
  35. package/manifests/deployment/mongo-express/deployment.yaml +60 -0
  36. package/manifests/deployment/phpmyadmin/deployment.yaml +54 -0
  37. package/manifests/kind-config-dev.yaml +12 -0
  38. package/manifests/kind-config.yaml +12 -0
  39. package/manifests/kubeadm-calico-config.yaml +119 -0
  40. package/manifests/letsencrypt-prod.yaml +15 -0
  41. package/manifests/mariadb/config.yaml +10 -0
  42. package/manifests/mariadb/kustomization.yaml +9 -0
  43. package/manifests/mariadb/pv.yaml +12 -0
  44. package/manifests/mariadb/pvc.yaml +10 -0
  45. package/manifests/mariadb/secret.yaml +8 -0
  46. package/manifests/mariadb/service.yaml +10 -0
  47. package/manifests/mariadb/statefulset.yaml +55 -0
  48. package/manifests/mongodb/backup-access.yaml +16 -0
  49. package/manifests/mongodb/backup-cronjob.yaml +42 -0
  50. package/manifests/mongodb/backup-pv-pvc.yaml +22 -0
  51. package/manifests/mongodb/configmap.yaml +26 -0
  52. package/manifests/mongodb/headless-service.yaml +10 -0
  53. package/manifests/mongodb/kustomization.yaml +11 -0
  54. package/manifests/mongodb/pv-pvc.yaml +23 -0
  55. package/manifests/mongodb/statefulset.yaml +125 -0
  56. package/manifests/mongodb-4.4/kustomization.yaml +7 -0
  57. package/manifests/mongodb-4.4/pv-pvc.yaml +23 -0
  58. package/manifests/mongodb-4.4/service-deployment.yaml +63 -0
  59. package/manifests/postgresql/configmap.yaml +9 -0
  60. package/manifests/postgresql/kustomization.yaml +10 -0
  61. package/manifests/postgresql/pv.yaml +15 -0
  62. package/manifests/postgresql/pvc.yaml +13 -0
  63. package/manifests/postgresql/service.yaml +10 -0
  64. package/manifests/postgresql/statefulset.yaml +37 -0
  65. package/manifests/valkey/kustomization.yaml +7 -0
  66. package/manifests/valkey/service.yaml +17 -0
  67. package/manifests/valkey/statefulset.yaml +41 -0
  68. package/package.json +127 -136
  69. package/src/api/core/core.service.js +1 -1
  70. package/src/api/default/default.service.js +1 -1
  71. package/src/api/user/user.model.js +16 -3
  72. package/src/api/user/user.service.js +15 -12
  73. package/src/cli/cluster.js +389 -0
  74. package/src/cli/cron.js +121 -0
  75. package/src/cli/db.js +222 -0
  76. package/src/cli/deploy.js +487 -0
  77. package/src/cli/env.js +58 -0
  78. package/src/cli/fs.js +161 -0
  79. package/src/cli/image.js +66 -0
  80. package/src/cli/index.js +312 -0
  81. package/src/cli/monitor.js +236 -0
  82. package/src/cli/repository.js +128 -0
  83. package/src/cli/script.js +53 -0
  84. package/src/cli/secrets.js +37 -0
  85. package/src/cli/test.js +118 -0
  86. package/src/client/components/core/Account.js +28 -24
  87. package/src/client/components/core/Auth.js +22 -4
  88. package/src/client/components/core/Blockchain.js +1 -1
  89. package/src/client/components/core/CalendarCore.js +128 -121
  90. package/src/client/components/core/CommonJs.js +283 -19
  91. package/src/client/components/core/CssCore.js +16 -4
  92. package/src/client/components/core/Docs.js +1 -2
  93. package/src/client/components/core/DropDown.js +5 -1
  94. package/src/client/components/core/EventsUI.js +3 -3
  95. package/src/client/components/core/FileExplorer.js +86 -78
  96. package/src/client/components/core/Input.js +22 -6
  97. package/src/client/components/core/JoyStick.js +2 -2
  98. package/src/client/components/core/LoadingAnimation.js +3 -12
  99. package/src/client/components/core/LogIn.js +3 -3
  100. package/src/client/components/core/LogOut.js +1 -1
  101. package/src/client/components/core/Modal.js +54 -20
  102. package/src/client/components/core/Panel.js +109 -90
  103. package/src/client/components/core/PanelForm.js +23 -30
  104. package/src/client/components/core/Recover.js +3 -3
  105. package/src/client/components/core/RichText.js +1 -11
  106. package/src/client/components/core/Router.js +3 -1
  107. package/src/client/components/core/Scroll.js +1 -0
  108. package/src/client/components/core/SignUp.js +2 -2
  109. package/src/client/components/core/Translate.js +47 -9
  110. package/src/client/components/core/Validator.js +9 -1
  111. package/src/client/components/core/VanillaJs.js +0 -9
  112. package/src/client/components/core/Worker.js +34 -31
  113. package/src/client/components/default/RoutesDefault.js +3 -2
  114. package/src/client/services/core/core.service.js +15 -10
  115. package/src/client/services/default/default.management.js +46 -37
  116. package/src/client/ssr/Render.js +6 -1
  117. package/src/client/ssr/body/CacheControl.js +2 -3
  118. package/src/client/sw/default.sw.js +3 -3
  119. package/src/db/mongo/MongooseDB.js +29 -1
  120. package/src/index.js +101 -19
  121. package/src/mailer/MailerProvider.js +3 -0
  122. package/src/runtime/lampp/Dockerfile +65 -0
  123. package/src/runtime/lampp/Lampp.js +1 -13
  124. package/src/runtime/xampp/Xampp.js +0 -13
  125. package/src/server/auth.js +3 -3
  126. package/src/server/backup.js +49 -93
  127. package/src/server/client-build.js +49 -46
  128. package/src/server/client-formatted.js +6 -3
  129. package/src/server/conf.js +297 -55
  130. package/src/server/dns.js +75 -62
  131. package/src/server/downloader.js +0 -8
  132. package/src/server/json-schema.js +77 -0
  133. package/src/server/logger.js +15 -10
  134. package/src/server/network.js +20 -161
  135. package/src/server/peer.js +2 -2
  136. package/src/server/process.js +25 -2
  137. package/src/server/proxy.js +7 -29
  138. package/src/server/runtime.js +53 -40
  139. package/src/server/ssl.js +1 -1
  140. package/src/server/start.js +122 -0
  141. package/src/server/valkey.js +27 -11
  142. package/test/api.test.js +0 -8
  143. package/src/dns.js +0 -22
  144. package/src/server/prompt-optimizer.js +0 -28
  145. package/startup.js +0 -11
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: mariadb
5
+ spec:
6
+ ports:
7
+ - port: 3306
8
+ targetPort: 3306
9
+ selector:
10
+ app: mariadb
@@ -0,0 +1,55 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: mariadb-statefulset
5
+ spec:
6
+ serviceName: mariadb
7
+ replicas: 1
8
+ selector:
9
+ matchLabels:
10
+ app: mariadb
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mariadb
15
+ spec:
16
+ containers:
17
+ - name: mariadb
18
+ image: mariadb:latest
19
+ env:
20
+ - name: MYSQL_ROOT_PASSWORD
21
+ valueFrom:
22
+ secretKeyRef:
23
+ name: mariadb-secret
24
+ key: password
25
+ # - name: MYSQL_PASSWORD
26
+ # valueFrom:
27
+ # secretKeyRef:
28
+ # name: mariadb-secret
29
+ # key: password
30
+ # - name: MYSQL_USER
31
+ # valueFrom:
32
+ # secretKeyRef:
33
+ # name: mariadb-secret
34
+ # key: username
35
+ # - name: MYSQL_DATABASE
36
+ # value: default
37
+ ports:
38
+ - containerPort: 3306
39
+ volumeMounts:
40
+ - mountPath: /var/lib/mysql
41
+ name: mariadb-storage
42
+ # - mountPath: /etc/mysql/conf.d
43
+ # name: config-volume
44
+ # volumes:
45
+ # - name: config-volume
46
+ # configMap:
47
+ # name: mariadb-config
48
+ volumeClaimTemplates:
49
+ - metadata:
50
+ name: mariadb-storage
51
+ spec:
52
+ accessModes: ['ReadWriteOnce']
53
+ resources:
54
+ requests:
55
+ storage: 1Gi
@@ -0,0 +1,16 @@
1
+ apiVersion: v1
2
+ kind: Pod
3
+ metadata:
4
+ name: backup-access
5
+ spec:
6
+ containers:
7
+ - name: busybox
8
+ image: busybox
9
+ command: ['sh', '-c', 'sleep 3600']
10
+ volumeMounts:
11
+ - name: backup-storage
12
+ mountPath: /backup
13
+ volumes:
14
+ - name: backup-storage
15
+ persistentVolumeClaim:
16
+ claimName: backup-pvc
@@ -0,0 +1,42 @@
1
+ apiVersion: batch/v1
2
+ kind: CronJob
3
+ metadata:
4
+ name: mongodb-backup
5
+ spec:
6
+ schedule: '*/5 * * * *' # Runs backup every five minutes
7
+ jobTemplate:
8
+ spec:
9
+ template:
10
+ spec:
11
+ containers:
12
+ - name: mongodump
13
+ image: docker.io/library/mongo:latest
14
+ command:
15
+ - sh
16
+ - -c
17
+ - |
18
+ # Perform backup
19
+ mongodump --host=mongodb-service --port=27017 --out=/backup/$(date +\%Y-\%m-\%dT\%H-\%M-\%S)
20
+ # Remove backups older than 7 days
21
+ find /backup -type d -mtime +7 -exec rm -rf {} +
22
+ volumeMounts:
23
+ - name: backup-storage
24
+ mountPath: /backup
25
+ restartPolicy: Never
26
+ volumes:
27
+ - name: backup-storage
28
+ persistentVolumeClaim:
29
+ claimName: backup-pvc
30
+ # mongodump -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --host=mongodb-service --port=27017 --out=/backup/$(date +\%Y-\%m-\%dT\%H-\%M-\%S)
31
+
32
+ # env:
33
+ # - name: MONGO_INITDB_ROOT_USERNAME
34
+ # valueFrom:
35
+ # secretKeyRef:
36
+ # name: mongodb-secret
37
+ # key: username
38
+ # - name: MONGO_INITDB_ROOT_PASSWORD
39
+ # valueFrom:
40
+ # secretKeyRef:
41
+ # name: mongodb-secret
42
+ # key: password
@@ -0,0 +1,22 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: backup-pv
5
+ spec:
6
+ capacity:
7
+ storage: 5Gi
8
+ accessModes:
9
+ - ReadWriteOnce
10
+ hostPath:
11
+ path: /mnt/backup
12
+ ---
13
+ apiVersion: v1
14
+ kind: PersistentVolumeClaim
15
+ metadata:
16
+ name: backup-pvc
17
+ spec:
18
+ accessModes:
19
+ - ReadWriteOnce
20
+ resources:
21
+ requests:
22
+ storage: 5Gi
@@ -0,0 +1,26 @@
1
+ # origin conf: /etc/mongod.conf
2
+ apiVersion: v1
3
+ kind: ConfigMap
4
+ metadata:
5
+ name: mongodb-config-file
6
+ namespace: default
7
+ data:
8
+ mongod.conf: |
9
+ storage:
10
+ dbPath: /data/db
11
+ systemLog:
12
+ destination: file
13
+ logAppend: true
14
+ path: /var/log/mongodb/mongod.log
15
+ replication:
16
+ replSetName: rs0
17
+ net:
18
+ bindIp: 127.0.0.1
19
+ port: 27017
20
+ processManagement:
21
+ fork: true
22
+ setParameter:
23
+ enableLocalhostAuthBypass: false
24
+ security:
25
+ authorization: enabled
26
+ keyFile: /etc/mongodb-keyfile
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: mongodb-service
5
+ spec:
6
+ clusterIP: None
7
+ selector:
8
+ app: mongodb
9
+ ports:
10
+ - port: 27017
@@ -0,0 +1,11 @@
1
+ ---
2
+ # kubectl apply -k core/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv-pvc.yaml
7
+ - headless-service.yaml
8
+ - statefulset.yaml
9
+ - backup-pv-pvc.yaml
10
+ # - backup-cronjob.yaml
11
+ # - backup-access.yaml
@@ -0,0 +1,23 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: mongodb-pv
5
+ spec:
6
+ capacity:
7
+ storage: 5Gi
8
+ accessModes:
9
+ - ReadWriteOnce
10
+ 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
@@ -0,0 +1,125 @@
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
+ replicas: 2
8
+ selector:
9
+ matchLabels:
10
+ app: mongodb
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mongodb
15
+ spec:
16
+ containers:
17
+ - name: mongodb
18
+ image: docker.io/library/mongo:latest
19
+ command:
20
+ - mongod
21
+ - '--replSet'
22
+ - 'rs0'
23
+ # - '--config'
24
+ # - '-f'
25
+ # - '/etc/mongod.conf'
26
+ # - '--auth'
27
+ # - '--clusterAuthMode'
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'
40
+ - '--bind_ip_all'
41
+ # command: ['sh', '-c']
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
75
+ ports:
76
+ - containerPort: 27017
77
+ volumeMounts:
78
+ - name: mongodb-storage
79
+ 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
+ env:
90
+ - name: MONGO_INITDB_ROOT_USERNAME
91
+ valueFrom:
92
+ secretKeyRef:
93
+ name: mongodb-secret
94
+ key: username
95
+ - name: MONGO_INITDB_ROOT_PASSWORD
96
+ valueFrom:
97
+ secretKeyRef:
98
+ name: mongodb-secret
99
+ key: password
100
+ resources:
101
+ requests:
102
+ cpu: '100m'
103
+ memory: '256Mi'
104
+ limits:
105
+ cpu: '500m'
106
+ memory: '512Mi'
107
+ volumes:
108
+ - name: keyfile
109
+ secret:
110
+ secretName: mongodb-keyfile
111
+ defaultMode: 0400
112
+ # - name: mongodb-configuration-file
113
+ # configMap:
114
+ # name: mongodb-config-file
115
+ # - name: mongodb-config
116
+ # configMap:
117
+ # name: mongodb-config
118
+ volumeClaimTemplates:
119
+ - metadata:
120
+ name: mongodb-storage
121
+ spec:
122
+ accessModes: ['ReadWriteOnce']
123
+ resources:
124
+ requests:
125
+ storage: 5Gi
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k core/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv-pvc.yaml
7
+ - service-deployment.yaml
@@ -0,0 +1,23 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolume
3
+ metadata:
4
+ name: mongodb-pv
5
+ spec:
6
+ capacity:
7
+ storage: 5Gi
8
+ accessModes:
9
+ - ReadWriteOnce
10
+ 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
@@ -0,0 +1,63 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: mongodb-deployment
5
+ namespace: default
6
+ spec:
7
+ selector:
8
+ matchLabels:
9
+ app: mongodb
10
+ replicas: 1
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: mongodb
15
+ spec:
16
+ hostname: mongo
17
+ containers:
18
+ - name: mongodb
19
+ image: mongo:4.4
20
+ command: ['mongod', '--replSet', 'rs0', '--bind_ip_all']
21
+ # -- bash
22
+ # mongo
23
+ # use admin
24
+ # rs.initiate()
25
+ ports:
26
+ - containerPort: 27017
27
+
28
+ volumeMounts:
29
+ - name: mongo-persistent-storage
30
+ mountPath: /data/db
31
+
32
+ # resources:
33
+ # requests:
34
+ # memory: '500Mi'
35
+ # cpu: '500m'
36
+ volumes:
37
+ - name: mongo-persistent-storage
38
+ persistentVolumeClaim:
39
+ claimName: mongodb-pvc
40
+
41
+ ---
42
+ apiVersion: v1
43
+ kind: Service
44
+ metadata:
45
+ name: mongodb-service
46
+ namespace: default
47
+ spec:
48
+ clusterIP: None
49
+ selector:
50
+ app: mongodb
51
+ ports:
52
+ - protocol: TCP
53
+ port: 27017
54
+ # targetPort: 27017
55
+ # type: ClusterIP
56
+
57
+ # rs.initiate();
58
+ # use admin;
59
+ # rs.initiate({ _id: "rs0", members: [ { _id: 0, host: "127.0.0.1:27017" } ] })
60
+ # db.createUser({user: "your_user",pwd: "your_password", roles: [{role: "userAdminAnyDatabase", db: "admin" },{ role: "readWriteAnyDatabase", db: "admin" }]});
61
+ # cfg = rs.conf();
62
+ # cfg.members[0].host = "127.0.0.1:27027";
63
+ # rs.reconfig(cfg);
@@ -0,0 +1,9 @@
1
+ apiVersion: v1
2
+ kind: ConfigMap
3
+ metadata:
4
+ name: postgres-config
5
+ labels:
6
+ app: postgres
7
+ data:
8
+ POSTGRES_DB: postgresdb
9
+ POSTGRES_USER: admin
@@ -0,0 +1,10 @@
1
+ ---
2
+ # kubectl apply -k postgresql/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - pv.yaml
7
+ - pvc.yaml
8
+ - configmap.yaml
9
+ - statefulset.yaml
10
+ - service.yaml
@@ -0,0 +1,15 @@
1
+ kind: PersistentVolume
2
+ apiVersion: v1
3
+ metadata:
4
+ name: postgres-pv-volume
5
+ labels:
6
+ type: local
7
+ app: postgres
8
+ spec:
9
+ storageClassName: manual
10
+ capacity:
11
+ storage: 5Gi
12
+ accessModes:
13
+ - ReadWriteMany
14
+ hostPath:
15
+ path: '/mnt/data'
@@ -0,0 +1,13 @@
1
+ kind: PersistentVolumeClaim
2
+ apiVersion: v1
3
+ metadata:
4
+ name: postgres-pv-claim
5
+ labels:
6
+ app: postgres
7
+ spec:
8
+ storageClassName: manual
9
+ accessModes:
10
+ - ReadWriteMany
11
+ resources:
12
+ requests:
13
+ storage: 5Gi
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: postgres-service
5
+ spec:
6
+ clusterIP: None
7
+ selector:
8
+ app: postgres
9
+ ports:
10
+ - port: 5432
@@ -0,0 +1,37 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: postgres
5
+ spec:
6
+ serviceName: postgres
7
+ replicas: 3
8
+ selector:
9
+ matchLabels:
10
+ app: postgres
11
+ template:
12
+ metadata:
13
+ labels:
14
+ app: postgres
15
+ spec:
16
+ containers:
17
+ - name: postgres
18
+ image: postgres:latest
19
+ imagePullPolicy: Never
20
+ ports:
21
+ - containerPort: 5432
22
+ envFrom:
23
+ - configMapRef:
24
+ name: postgres-config
25
+ env:
26
+ - name: POSTGRES_PASSWORD
27
+ valueFrom:
28
+ secretKeyRef:
29
+ name: postgres-secret
30
+ key: password
31
+ volumeMounts:
32
+ - mountPath: /var/lib/postgresql/data
33
+ name: postgredb
34
+ volumes:
35
+ - name: postgredb
36
+ persistentVolumeClaim:
37
+ claimName: postgres-pv-claim
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k valkey/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - service.yaml
7
+ - statefulset.yaml
@@ -0,0 +1,17 @@
1
+ ---
2
+ apiVersion: v1
3
+ kind: Service
4
+ metadata:
5
+ name: service-valkey
6
+ namespace: default
7
+ spec:
8
+ ports:
9
+ - port: 6379
10
+ targetPort: 6379
11
+ selector:
12
+ app: service-valkey
13
+ ipFamilyPolicy: PreferDualStack
14
+ ipFamilies:
15
+ - IPv4
16
+ # - IPv6
17
+ type: ClusterIP
@@ -0,0 +1,41 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: service-valkey
5
+ namespace: default
6
+ spec:
7
+ serviceName: service-valkey
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: service-valkey
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: service-valkey
16
+ spec:
17
+ # Prevent automatic token mounting if you're not using the default ServiceAccount
18
+ automountServiceAccountToken: false
19
+
20
+ containers:
21
+ - name: service-valkey
22
+ image: valkey/valkey:latest
23
+ # Ensure you pull only if not present (Never will error if missing)
24
+ imagePullPolicy: Never
25
+ env:
26
+ - name: TZ
27
+ value: Europe/Zurich
28
+ ports:
29
+ - containerPort: 6379
30
+ startupProbe:
31
+ tcpSocket:
32
+ port: 6379
33
+ failureThreshold: 30
34
+ periodSeconds: 5
35
+ timeoutSeconds: 5
36
+ livenessProbe:
37
+ tcpSocket:
38
+ port: 6379
39
+ failureThreshold: 2
40
+ periodSeconds: 30
41
+ timeoutSeconds: 5