cyberia 2.89.2 → 2.89.45

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 (64) hide show
  1. package/.env.development +2 -0
  2. package/.env.production +2 -0
  3. package/.env.test +2 -0
  4. package/.github/workflows/engine-cyberia.cd.yml +4 -0
  5. package/.github/workflows/release.cd.yml +2 -0
  6. package/bin/cyberia.js +10 -7
  7. package/bin/deploy.js +22 -15
  8. package/bin/index.js +10 -7
  9. package/cli.md +105 -54
  10. package/deployment.yaml +34 -6
  11. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  12. package/manifests/deployment/dd-test-development/deployment.yaml +18 -6
  13. package/manifests/deployment/dd-test-development/proxy.yaml +2 -0
  14. package/manifests/deployment/kafka/deployment.yaml +0 -2
  15. package/manifests/deployment/spark/spark-pi-py.yaml +0 -1
  16. package/manifests/deployment/tensorflow/tf-gpu-test.yaml +0 -2
  17. package/manifests/envoy-service-nodeport.yaml +0 -1
  18. package/manifests/kubeadm-calico-config.yaml +10 -115
  19. package/manifests/letsencrypt-prod.yaml +0 -1
  20. package/manifests/mariadb/statefulset.yaml +1 -1
  21. package/manifests/mongodb/statefulset.yaml +11 -11
  22. package/manifests/mongodb-4.4/service-deployment.yaml +1 -3
  23. package/manifests/mysql/pv-pvc.yaml +1 -1
  24. package/manifests/mysql/statefulset.yaml +1 -1
  25. package/manifests/pv-pvc-dd.yaml +34 -0
  26. package/manifests/valkey/service.yaml +0 -1
  27. package/manifests/valkey/statefulset.yaml +2 -3
  28. package/package.json +1 -1
  29. package/proxy.yaml +6 -0
  30. package/scripts/device-scan.sh +43 -21
  31. package/scripts/gen-fqdns.sh +14 -0
  32. package/scripts/ip-info.sh +118 -0
  33. package/scripts/rpmfusion-ffmpeg-setup.sh +1 -0
  34. package/src/api/object-layer/object-layer.controller.js +19 -0
  35. package/src/api/object-layer/object-layer.router.js +4 -0
  36. package/src/api/object-layer/object-layer.service.js +111 -0
  37. package/src/api/user/user.model.js +10 -1
  38. package/src/cli/cluster.js +88 -75
  39. package/src/cli/deploy.js +165 -85
  40. package/src/cli/index.js +44 -3
  41. package/src/cli/monitor.js +12 -6
  42. package/src/cli/repository.js +13 -1
  43. package/src/cli/run.js +127 -60
  44. package/src/client/components/core/Logger.js +1 -1
  45. package/src/client/components/core/Modal.js +5 -0
  46. package/src/client/components/core/ObjectLayerEngineModal.js +336 -72
  47. package/src/client/components/core/ObjectLayerEngineViewer.js +239 -420
  48. package/src/client/components/core/Router.js +10 -1
  49. package/src/client/components/cyberia-portal/LogInCyberiaPortal.js +1 -1
  50. package/src/client/components/cyberia-portal/LogOutCyberiaPortal.js +1 -1
  51. package/src/client/components/cyberia-portal/MenuCyberiaPortal.js +1 -1
  52. package/src/client/components/cyberia-portal/ObjectLayerCyberiaPortal.js +44 -4
  53. package/src/client/services/default/default.management.js +25 -5
  54. package/src/client/services/object-layer/object-layer.management.js +8 -8
  55. package/src/client/services/object-layer/object-layer.service.js +34 -0
  56. package/src/index.js +1 -1
  57. package/src/server/client-build.js +5 -4
  58. package/src/server/conf.js +1 -1
  59. package/src/server/start.js +3 -1
  60. package/manifests/kubelet-config.yaml +0 -65
  61. package/manifests/mongodb/backup-access.yaml +0 -16
  62. package/manifests/mongodb/backup-cronjob.yaml +0 -42
  63. package/manifests/mongodb/backup-pv-pvc.yaml +0 -22
  64. package/manifests/mongodb/configmap.yaml +0 -26
@@ -189,7 +189,16 @@ const Router = function (options = { Routes: () => {}, e: new PopStateEvent() })
189
189
  */
190
190
  const LoadRouter = function (RouterInstance) {
191
191
  Router(RouterInstance);
192
- window.onpopstate = (e) => Router({ ...RouterInstance, e });
192
+ window.onpopstate = (e) => {
193
+ Router({ ...RouterInstance, e });
194
+ // Notify query params listeners on browser back/forward navigation
195
+ const updatedParams = getQueryParams();
196
+ for (const listenerId in queryParamsChangeListeners) {
197
+ if (Object.hasOwnProperty.call(queryParamsChangeListeners, listenerId)) {
198
+ queryParamsChangeListeners[listenerId](updatedParams);
199
+ }
200
+ }
201
+ };
193
202
  };
194
203
 
195
204
  /**
@@ -11,7 +11,7 @@ const LogInCyberiaPortal = async function () {
11
11
  ElementsCyberiaPortal.Data.user.main.model.user = user;
12
12
 
13
13
  // if (user.role === 'admin' || user.role === 'moderator') s(`.main-btn-admin`).classList.remove('hide');
14
- await ObjectLayerManagement.Reload();
14
+ await ObjectLayerManagement.Reload('viewer');
15
15
  };
16
16
  const { user } = await Auth.sessionIn();
17
17
  ElementsCyberiaPortal.Data.user.main.model.user = user;
@@ -7,7 +7,7 @@ const LogOutCyberiaPortal = async function () {
7
7
  LogOut.Event['LogOutCyberiaPortal'] = async (result = { user: { _id: '' } }) => {
8
8
  ElementsCyberiaPortal.Data.user.main.model.user = result.user;
9
9
  s(`.main-btn-admin`).classList.add('hide');
10
- await ObjectLayerManagement.Reload();
10
+ await ObjectLayerManagement.Reload('viewer');
11
11
  };
12
12
  };
13
13
 
@@ -172,7 +172,7 @@ const MenuCyberiaPortal = {
172
172
  tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('object-layer-engine')),
173
173
  })}
174
174
  ${await BtnIcon.Render({
175
- class: 'in wfa main-btn-menu main-btn-object-layer-engine-management',
175
+ class: 'in wfa main-btn-menu main-btn-object-layer-engine-management hide',
176
176
  useMenuBtn: true,
177
177
  label: renderMenuLabel({
178
178
  icon: html`<img class="inl cyberia-menu-icon" src="${getProxyPath()}assets/ui-icons/engine.png" />`,
@@ -66,7 +66,6 @@ const ObjectLayerCyberiaPortal = {
66
66
  right: 0;
67
67
  bottom: 0;
68
68
  background: rgba(0, 0, 0, 0.6);
69
- backdrop-filter: blur(2px);
70
69
  }
71
70
  .hero-content {
72
71
  z-index: 1;
@@ -126,10 +125,22 @@ const ObjectLayerCyberiaPortal = {
126
125
  }
127
126
  .features-grid {
128
127
  display: grid;
129
- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
128
+ grid-template-columns: repeat(auto-fit, minmax(100%, 1fr)); /* Default to 1 column */
130
129
  gap: 2rem;
131
130
  margin-top: 3rem;
132
131
  }
132
+
133
+ @media (min-width: 576px) {
134
+ .features-grid {
135
+ grid-template-columns: repeat(auto-fit, minmax(45%, 1fr)); /* 2 columns */
136
+ }
137
+ }
138
+
139
+ @media (min-width: 992px) {
140
+ .features-grid {
141
+ grid-template-columns: repeat(auto-fit, minmax(22%, 1fr)); /* 4 columns */
142
+ }
143
+ }
133
144
  .feature-card {
134
145
  background: var(--card-bg-color);
135
146
  padding: 2.5rem 2rem;
@@ -172,6 +183,29 @@ const ObjectLayerCyberiaPortal = {
172
183
  transform: translateY(0);
173
184
  }
174
185
  }
186
+
187
+ /* Responsive Styles */
188
+ @media (max-width: 650px) {
189
+ .hero-content h1 {
190
+ font-size: 2.2rem;
191
+ }
192
+ .hero-content p {
193
+ font-size: 1rem;
194
+ }
195
+ .hero-content .logo-image {
196
+ max-width: 180px;
197
+ }
198
+ .cta-button {
199
+ padding: 12px 28px;
200
+ font-size: 1rem;
201
+ }
202
+ .features-section {
203
+ padding: 3rem 1rem;
204
+ }
205
+ .features-section h2 {
206
+ font-size: 2rem;
207
+ }
208
+ }
175
209
  </style> `,
176
210
  );
177
211
  };
@@ -186,8 +220,8 @@ const ObjectLayerCyberiaPortal = {
186
220
  <section class="hero-section">
187
221
  <div class="hero-content">
188
222
  <img src="${getProxyPath()}assets/ui-icons/cyberia-white.png" alt="Cyberia Logo" class="logo-image" />
189
- <h1>CYBERIA</h1>
190
- <p style="color: #fff;">
223
+ <h1 style="margin: 10px">CYBERIA</h1>
224
+ <p style="color: #fff; margin: 10px 20px 10px 20px;">
191
225
  An action-packed Hack and Slash MMORPG. Explore a dynamic online sandbox pixel art universe, right from
192
226
  your browser.
193
227
  </p>
@@ -217,6 +251,12 @@ const ObjectLayerCyberiaPortal = {
217
251
  description:
218
252
  'Hunt for epic loot, gather rare resources, and craft powerful gear to define your playstyle.',
219
253
  },
254
+ {
255
+ icon: 'wallet.png',
256
+ title: 'Earn While You Play',
257
+ description:
258
+ 'Engage in an innovative play-to-earn economy. Trade items, complete quests, and earn rewards.',
259
+ },
220
260
  ]
221
261
  .map(
222
262
  (feature) => html`
@@ -52,12 +52,32 @@ const columnDefFormatter = (obj, columnDefs, customFormat) => {
52
52
 
53
53
  const DefaultManagement = {
54
54
  Tokens: {},
55
- loadTable: async function (id, options = { reload: true }) {
55
+ loadTable: async function (id, options = { reload: true, force: true }) {
56
56
  const { serviceId, columnDefs, customFormat } = this.Tokens[id];
57
+
58
+ let _page = this.Tokens[id].page;
59
+ let _limit = this.Tokens[id].limit;
60
+ let _id = this.Tokens[id].serviceOptions?.get?.id ?? undefined;
61
+ if (!options.force && this.Tokens[id].lastOptions) {
62
+ if (
63
+ _page === this.Tokens[id].lastOptions.page &&
64
+ _limit === this.Tokens[id].lastOptions.limit &&
65
+ _id === this.Tokens[id].lastOptions.id
66
+ ) {
67
+ logger.warn(`DefaultManagement loadTable ${serviceId} - Skipping load, options unchanged`);
68
+ return;
69
+ }
70
+ }
71
+ this.Tokens[id].lastOptions = {
72
+ page: _page,
73
+ limit: _limit,
74
+ id: _id,
75
+ };
76
+
57
77
  const result = await this.Tokens[id].ServiceProvider.get({
58
- page: this.Tokens[id].page,
59
- limit: this.Tokens[id].limit,
60
- id: this.Tokens[id].serviceOptions?.get?.id ?? undefined,
78
+ page: _page,
79
+ limit: _limit,
80
+ id: _id,
61
81
  });
62
82
  if (result.status === 'success') {
63
83
  const { data, total, page, totalPages } = result.data;
@@ -331,7 +351,7 @@ const DefaultManagement = {
331
351
  EventsUI.onClick(`.management-table-btn-reload-${id}`, async () => {
332
352
  try {
333
353
  // Reload data from server
334
- await DefaultManagement.loadTable(id);
354
+ await DefaultManagement.loadTable(id, { force: true, reload: true });
335
355
 
336
356
  // Other option: Refresh cells to update UI
337
357
  // DefaultManagement.refreshTable(id);
@@ -9,7 +9,7 @@ import { Modal } from '../../components/core/Modal.js';
9
9
  import { BtnIcon } from '../../components/core/BtnIcon.js';
10
10
 
11
11
  const ObjectLayerManagement = {
12
- RenderTable: async ({ Elements }) => {
12
+ RenderTable: async ({ Elements, idModal }) => {
13
13
  const user = Elements.Data.user.main.model.user;
14
14
  const { role } = user;
15
15
 
@@ -40,9 +40,9 @@ const ObjectLayerManagement = {
40
40
  // Navigate to viewer route first
41
41
  setPath(`${getProxyPath()}object-layer-engine-viewer`);
42
42
  // Then add query param without replacing history
43
- setQueryParams({ cid: data._id }, { replace: false });
43
+ setQueryParams({ cid: data._id }, { replace: true });
44
44
  if (s(`.modal-object-layer-engine-viewer`)) {
45
- await ObjectLayerEngineViewer.Reload();
45
+ await ObjectLayerEngineViewer.Reload({ Elements });
46
46
  }
47
47
  s(`.main-btn-object-layer-engine-viewer`).click();
48
48
  });
@@ -85,7 +85,7 @@ const ObjectLayerManagement = {
85
85
  // Navigate to editor route first
86
86
  setPath(`${getProxyPath()}object-layer-engine`);
87
87
  // Then add query param without replacing history
88
- setQueryParams({ cid: data._id }, { replace: false });
88
+ setQueryParams({ cid: data._id }, { replace: true });
89
89
  if (s(`.modal-object-layer-engine`)) await ObjectLayerEngineModal.Reload();
90
90
  else s(`.main-btn-object-layer-engine`).click();
91
91
  });
@@ -177,7 +177,7 @@ const ObjectLayerManagement = {
177
177
  ];
178
178
 
179
179
  return await DefaultManagement.RenderTable({
180
- idModal: 'modal-object-layer-engine-management',
180
+ idModal: idModal ? idModal : 'modal-object-layer-engine-management',
181
181
  serviceId: 'object-layer-engine-management',
182
182
  entity: 'object-layer',
183
183
  permissions: {
@@ -213,9 +213,9 @@ const ObjectLayerManagement = {
213
213
  },
214
214
  });
215
215
  },
216
- Reload: async function () {
217
- const idModal = 'modal-object-layer-engine-management';
218
- if (s(`.modal-object-layer-engine-management`))
216
+ Reload: async function (subModalId = 'management') {
217
+ const idModal = `modal-object-layer-engine-${subModalId}`;
218
+ if (s(`.modal-object-layer-engine-${subModalId}`))
219
219
  Modal.writeHTML({
220
220
  idModal,
221
221
  html: await Modal.Data[idModal].options.html(),
@@ -155,6 +155,40 @@ const ObjectLayerService = {
155
155
  return reject(error);
156
156
  }),
157
157
  ),
158
+ generateWebp: (options = { itemType: '', itemId: '', directionCode: '' }) => {
159
+ const url = new URL(
160
+ getApiBaseUrl({
161
+ id: `generate-webp/${options.itemType}/${options.itemId}/${options.directionCode}`,
162
+ endpoint,
163
+ }),
164
+ );
165
+ return new Promise((resolve, reject) =>
166
+ fetch(url.toString(), {
167
+ method: 'GET',
168
+ headers: headersFactory(),
169
+ credentials: 'include',
170
+ })
171
+ .then(async (res) => {
172
+ if (!res.ok) {
173
+ const errorData = await res.json();
174
+ throw new Error(errorData.message || 'Failed to generate WebP');
175
+ }
176
+ // Get the blob data
177
+ const blob = await res.blob();
178
+ // Create a blob URL for display
179
+ const blobUrl = URL.createObjectURL(blob);
180
+ return { status: 'success', data: blobUrl };
181
+ })
182
+ .then((res) => {
183
+ logger.info(res);
184
+ return resolve(res);
185
+ })
186
+ .catch((error) => {
187
+ logger.error(error);
188
+ return reject(error);
189
+ }),
190
+ );
191
+ },
158
192
  };
159
193
 
160
194
  export { ObjectLayerService };
package/src/index.js CHANGED
@@ -35,7 +35,7 @@ class Underpost {
35
35
  * @type {String}
36
36
  * @memberof Underpost
37
37
  */
38
- static version = 'v2.89.2';
38
+ static version = 'v2.89.45';
39
39
  /**
40
40
  * Repository cli API
41
41
  * @static
@@ -84,11 +84,12 @@ const copyNonExistingFiles = (src, dest) => {
84
84
  * @param {Object} options - Options for the build process.
85
85
  * @param {Array} options.liveClientBuildPaths - List of paths to build incrementally.
86
86
  * @param {Array} options.instances - List of instances to build.
87
+ * @param {boolean} options.buildZip - Whether to create zip files of the builds.
87
88
  * @returns {Promise<void>} - Promise that resolves when the build is complete.
88
89
  * @throws {Error} - If the build fails.
89
90
  * @memberof clientBuild
90
91
  */
91
- const buildClient = async (options = { liveClientBuildPaths: [], instances: [] }) => {
92
+ const buildClient = async (options = { liveClientBuildPaths: [], instances: [], buildZip: false }) => {
92
93
  const logger = loggerFactory(import.meta);
93
94
  const confClient = JSON.parse(fs.readFileSync(`./conf/conf.client.json`, 'utf8'));
94
95
  const confServer = JSON.parse(fs.readFileSync(`./conf/conf.server.json`, 'utf8'));
@@ -266,7 +267,7 @@ const buildClient = async (options = { liveClientBuildPaths: [], instances: [] }
266
267
  const rootClientPath = directory ? directory : `${publicPath}/${host}${path}`;
267
268
  const port = newInstance(currentPort);
268
269
  const publicClientId = publicRef ? publicRef : client;
269
- const fullBuildEnabled = !process.argv.includes('l') && !confServer[host][path].liteBuild && !enableLiveRebuild;
270
+ const fullBuildEnabled = !confServer[host][path].liteBuild && !enableLiveRebuild;
270
271
  // const baseHost = process.env.NODE_ENV === 'production' ? `https://${host}` : `http://localhost:${port}`;
271
272
  const baseHost = process.env.NODE_ENV === 'production' ? `https://${host}` : ``;
272
273
  // ''; // process.env.NODE_ENV === 'production' ? `https://${host}` : ``;
@@ -625,7 +626,7 @@ Sitemap: https://${host}${path === '/' ? '' : path}/sitemap.xml`,
625
626
  );
626
627
  }
627
628
 
628
- if (fullBuildEnabled && !enableLiveRebuild && !process.argv.includes('l') && docsBuild) {
629
+ if (fullBuildEnabled && !enableLiveRebuild && docsBuild) {
629
630
  await buildDocs({
630
631
  host,
631
632
  path,
@@ -716,7 +717,7 @@ ${fs.readFileSync(`${rootClientPath}/sw.js`, 'utf8')}`,
716
717
  );
717
718
  }
718
719
  }
719
- if (!enableLiveRebuild && process.argv.includes('zip')) {
720
+ if (!enableLiveRebuild && options.buildZip) {
720
721
  logger.warn('build zip', rootClientPath);
721
722
 
722
723
  if (!fs.existsSync('./build')) fs.mkdirSync('./build');
@@ -1192,7 +1192,7 @@ const Cmd = {
1192
1192
  * @returns {string} - The build command.
1193
1193
  * @memberof Cmd
1194
1194
  */
1195
- build: (deployId) => `node bin/deploy build-full-client ${deployId}${process.argv.includes('l') ? ' l' : ''}`,
1195
+ build: (deployId) => `node bin/deploy build-full-client ${deployId}`,
1196
1196
  /**
1197
1197
  * @method conf
1198
1198
  * @description Configures the deploy.
@@ -132,7 +132,9 @@ class UnderpostStartUp {
132
132
  const buildBasePath = `/home/dd`;
133
133
  const repoName = `engine-${deployId.split('-')[1]}`;
134
134
  shellExec(`cd ${buildBasePath} && underpost clone ${process.env.GITHUB_USERNAME}/${repoName}`);
135
- shellExec(`cd ${buildBasePath} && sudo mv ./${repoName} ./engine`);
135
+ shellExec(`mkdir -p ${buildBasePath}/engine`);
136
+ shellExec(`cd ${buildBasePath} && sudo cp -a ./${repoName}/. ./engine`);
137
+ shellExec(`cd ${buildBasePath} && sudo rm -rf ./${repoName}`);
136
138
  shellExec(`cd ${buildBasePath}/engine && underpost clone ${process.env.GITHUB_USERNAME}/${repoName}-private`);
137
139
  shellExec(`cd ${buildBasePath}/engine && sudo mv ./${repoName}-private ./engine-private`);
138
140
  shellCd(`${buildBasePath}/engine`);
@@ -1,65 +0,0 @@
1
- apiVersion: v1
2
- data:
3
- kubelet: |
4
- apiVersion: kubelet.config.k8s.io/v1beta1
5
- authentication:
6
- anonymous:
7
- enabled: false
8
- webhook:
9
- cacheTTL: 0s
10
- enabled: true
11
- x509:
12
- clientCAFile: /etc/kubernetes/pki/ca.crt
13
- authorization:
14
- mode: Webhook
15
- webhook:
16
- cacheAuthorizedTTL: 0s
17
- cacheUnauthorizedTTL: 0s
18
- cgroupDriver: systemd
19
- clusterDNS:
20
- - 10.96.0.10
21
- clusterDomain: cluster.local
22
- containerRuntimeEndpoint: unix:///run/containerd/containerd.sock
23
- cpuManagerReconcilePeriod: 0s
24
- crashLoopBackOff: {}
25
- evictionHard:
26
- imagefs.available: "5%" # Adjusted for more tolerance
27
- memory.available: "100Mi"
28
- nodefs.available: "5%" # Adjusted for more tolerance
29
- nodefs.inodesFree: "5%"
30
- evictionPressureTransitionPeriod: 0s
31
- fileCheckFrequency: 0s
32
- healthzBindAddress: 127.0.0.1
33
- healthzPort: 10248
34
- httpCheckFrequency: 0s
35
- imageMaximumGCAge: 0s
36
- imageMinimumGCAge: 0s
37
- kind: KubeletConfiguration
38
- logging:
39
- flushFrequency: 0
40
- options:
41
- json:
42
- infoBufferSize: "0"
43
- text:
44
- infoBufferSize: "0"
45
- verbosity: 0
46
- memorySwap: {}
47
- nodeStatusReportFrequency: 0s
48
- nodeStatusUpdateFrequency: 0s
49
- rotateCertificates: true
50
- runtimeRequestTimeout: 0s
51
- shutdownGracePeriod: 0s
52
- shutdownGracePeriodCriticalPods: 0s
53
- staticPodPath: /etc/kubernetes/manifests
54
- streamingConnectionIdleTimeout: 0s
55
- syncFrequency: 0s
56
- volumeStatsAggPeriod: 0s
57
- kind: ConfigMap
58
- metadata:
59
- annotations:
60
- kubeadm.kubernetes.io/component-config.hash: sha256:26488e9fc7c5cb5fdda9996cda2e6651a9af5febce07ea02de11bd3ef3f49e9c
61
- creationTimestamp: "2025-06-30T12:42:00Z"
62
- name: kubelet-config
63
- namespace: kube-system
64
- resourceVersion: "204"
65
- uid: a85321a8-f3e0-40fa-8e4e-9d33b8842e7a
@@ -1,16 +0,0 @@
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
@@ -1,42 +0,0 @@
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
@@ -1,22 +0,0 @@
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
@@ -1,26 +0,0 @@
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