underpost 2.89.1 → 2.89.21
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/.env.development +2 -0
- package/.env.production +2 -0
- package/.env.test +2 -0
- package/.github/workflows/release.cd.yml +2 -0
- package/README.md +2 -3
- package/cli.md +123 -94
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +10 -2
- package/manifests/deployment/dd-test-development/proxy.yaml +4 -0
- package/manifests/grafana/deployment.yaml +7 -0
- package/manifests/grafana/kustomization.yaml +1 -1
- package/manifests/grafana/pvc.yaml +1 -1
- package/manifests/grafana/storage-class.yaml +9 -0
- package/manifests/pv-pvc-dd.yaml +34 -0
- package/package.json +1 -1
- package/src/cli/cluster.js +40 -18
- package/src/cli/deploy.js +193 -77
- package/src/cli/index.js +20 -1
- package/src/cli/repository.js +12 -0
- package/src/cli/run.js +185 -68
- package/src/client/components/core/ObjectLayerEngineModal.js +4 -3
- package/src/client/components/core/ObjectLayerEngineViewer.js +83 -31
- package/src/index.js +1 -1
- package/src/server/start.js +2 -1
package/.env.development
CHANGED
|
@@ -22,6 +22,8 @@ ROUTER=changethis
|
|
|
22
22
|
CLOUDINARY_CLOUD_NAME=changethis
|
|
23
23
|
CLOUDINARY_API_KEY=changethis
|
|
24
24
|
CLOUDINARY_API_SECRET=changethis
|
|
25
|
+
CLOUDINARY_PASSWORD=changethis
|
|
26
|
+
CLOUDINARY_EMAIL=admin@default.net
|
|
25
27
|
DB_PG_MAAS_NAME=changethis
|
|
26
28
|
DB_PG_MAAS_PASS=changethis
|
|
27
29
|
DB_PG_MAAS_USER=changethis
|
package/.env.production
CHANGED
|
@@ -23,6 +23,8 @@ ROUTER=changethis
|
|
|
23
23
|
CLOUDINARY_CLOUD_NAME=changethis
|
|
24
24
|
CLOUDINARY_API_KEY=changethis
|
|
25
25
|
CLOUDINARY_API_SECRET=changethis
|
|
26
|
+
CLOUDINARY_PASSWORD=changethis
|
|
27
|
+
CLOUDINARY_EMAIL=admin@default.net
|
|
26
28
|
DB_PG_MAAS_NAME=changethis
|
|
27
29
|
DB_PG_MAAS_PASS=changethis
|
|
28
30
|
DB_PG_MAAS_USER=changethis
|
package/.env.test
CHANGED
|
@@ -22,6 +22,8 @@ ROUTER=changethis
|
|
|
22
22
|
CLOUDINARY_CLOUD_NAME=changethis
|
|
23
23
|
CLOUDINARY_API_KEY=changethis
|
|
24
24
|
CLOUDINARY_API_SECRET=changethis
|
|
25
|
+
CLOUDINARY_PASSWORD=changethis
|
|
26
|
+
CLOUDINARY_EMAIL=admin@default.net
|
|
25
27
|
DB_PG_MAAS_NAME=changethis
|
|
26
28
|
DB_PG_MAAS_PASS=changethis
|
|
27
29
|
DB_PG_MAAS_USER=changethis
|
|
@@ -22,6 +22,8 @@ jobs:
|
|
|
22
22
|
key: ${{ secrets.SSH_PRIV_KEY }}
|
|
23
23
|
# Remote port (optional)
|
|
24
24
|
port: ${{ secrets.SSH_PORT }}
|
|
25
|
+
# Optional: increase timeout for long-running commands
|
|
26
|
+
command_timeout: 60m
|
|
25
27
|
# Optional: if your private key has a passphrase, add:
|
|
26
28
|
# passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
|
|
27
29
|
# Commands to run on the remote VM
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- badges -->
|
|
20
20
|
|
|
21
|
-
[](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [](https://www.npmjs.com/package/underpost) [](https://socket.dev/npm/package/underpost/overview/2.89.21) [](https://coveralls.io/github/underpostnet/engine?branch=master) [](https://www.npmjs.org/package/underpost) [](https://www.npmjs.com/package/underpost)
|
|
22
22
|
|
|
23
23
|
<!-- end-badges -->
|
|
24
24
|
|
|
@@ -66,7 +66,7 @@ Run dev client server
|
|
|
66
66
|
npm run dev
|
|
67
67
|
```
|
|
68
68
|
<!-- -->
|
|
69
|
-
## underpost ci/cd cli v2.89.
|
|
69
|
+
## underpost ci/cd cli v2.89.21
|
|
70
70
|
|
|
71
71
|
### Usage: `underpost [options] [command]`
|
|
72
72
|
```
|
|
@@ -106,4 +106,3 @@ Commands:
|
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
<a target="_top" href="https://github.com/underpostnet/pwa-microservices-template/blob/master/cli.md">See complete CLI Docs here.</a>
|
|
109
|
-
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.89.
|
|
1
|
+
## underpost ci/cd cli v2.89.21
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -146,6 +146,9 @@ Options:
|
|
|
146
146
|
--deploy-id <deploy-id> Sets the deployment configuration ID for the commit
|
|
147
147
|
context.
|
|
148
148
|
--cached Commit staged changes only or context.
|
|
149
|
+
--hashes <hashes> Comma-separated list of specific file hashes of
|
|
150
|
+
commits.
|
|
151
|
+
--extension <extension> specific file extensions of commits.
|
|
149
152
|
-h, --help display help for command
|
|
150
153
|
|
|
151
154
|
```
|
|
@@ -228,56 +231,66 @@ Options:
|
|
|
228
231
|
Manages Kubernetes clusters, defaulting to Kind cluster initialization.
|
|
229
232
|
|
|
230
233
|
Arguments:
|
|
231
|
-
pod-name
|
|
234
|
+
pod-name Optional: Filters information by a specific pod
|
|
235
|
+
name.
|
|
232
236
|
|
|
233
237
|
Options:
|
|
234
|
-
--reset
|
|
235
|
-
|
|
236
|
-
--mariadb
|
|
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
|
-
|
|
238
|
+
--reset Deletes all clusters and prunes all related data
|
|
239
|
+
and caches.
|
|
240
|
+
--mariadb Initializes the cluster with a MariaDB
|
|
241
|
+
statefulset.
|
|
242
|
+
--mysql Initializes the cluster with a MySQL statefulset.
|
|
243
|
+
--mongodb Initializes the cluster with a MongoDB
|
|
244
|
+
statefulset.
|
|
245
|
+
--mongo-db-host <host> Set custom mongo db host
|
|
246
|
+
--postgresql Initializes the cluster with a PostgreSQL
|
|
247
|
+
statefulset.
|
|
248
|
+
--mongodb4 Initializes the cluster with a MongoDB 4.4
|
|
249
|
+
service.
|
|
250
|
+
--valkey Initializes the cluster with a Valkey service.
|
|
251
|
+
--contour Initializes the cluster with Project Contour base
|
|
252
|
+
HTTPProxy and Envoy.
|
|
253
|
+
--cert-manager Initializes the cluster with a Let's Encrypt
|
|
254
|
+
production ClusterIssuer.
|
|
255
|
+
--dedicated-gpu Initializes the cluster with dedicated GPU base
|
|
256
|
+
resources and environment settings.
|
|
257
|
+
--info Retrieves information about all deployed
|
|
258
|
+
Kubernetes objects.
|
|
259
|
+
--full Initializes the cluster with all available
|
|
260
|
+
statefulsets and services.
|
|
261
|
+
--ns-use <ns-name> Switches the current Kubernetes context to the
|
|
262
|
+
specified namespace.
|
|
263
|
+
--kubeadm Initializes the cluster using kubeadm for control
|
|
264
|
+
plane management.
|
|
265
|
+
--grafana Initializes the cluster with a Grafana
|
|
266
|
+
deployment.
|
|
267
|
+
--prom [hosts] Initializes the cluster with a Prometheus
|
|
268
|
+
Operator deployment and monitor scrap for
|
|
269
|
+
specified hosts.
|
|
270
|
+
--dev Initializes a development-specific cluster
|
|
271
|
+
configuration.
|
|
272
|
+
--list-pods Displays detailed information about all pods.
|
|
273
|
+
--info-capacity Displays the current total machine capacity
|
|
274
|
+
information.
|
|
275
|
+
--info-capacity-pod Displays the current machine capacity information
|
|
276
|
+
per pod.
|
|
277
|
+
--pull-image Sets an optional associated image to pull during
|
|
278
|
+
initialization.
|
|
279
|
+
--init-host Installs necessary Kubernetes node CLI tools
|
|
280
|
+
(e.g., kind, kubeadm, docker, podman, helm).
|
|
281
|
+
--uninstall-host Uninstalls all host components installed by
|
|
282
|
+
init-host.
|
|
283
|
+
--config Sets the base Kubernetes node configuration.
|
|
284
|
+
--worker Sets the context for a worker node.
|
|
285
|
+
--chown Sets the appropriate ownership for Kubernetes
|
|
286
|
+
kubeconfig files.
|
|
287
|
+
--k3s Initializes the cluster using K3s (Lightweight
|
|
288
|
+
Kubernetes).
|
|
289
|
+
--hosts <hosts> A comma-separated list of cluster hostnames or IP
|
|
290
|
+
addresses.
|
|
291
|
+
--remove-volume-host-paths Removes specified volume host paths after
|
|
292
|
+
execution.
|
|
293
|
+
-h, --help display help for command
|
|
281
294
|
|
|
282
295
|
```
|
|
283
296
|
|
|
@@ -289,50 +302,55 @@ Options:
|
|
|
289
302
|
Manages application deployments, defaulting to deploying development pods.
|
|
290
303
|
|
|
291
304
|
Arguments:
|
|
292
|
-
deploy-list
|
|
293
|
-
|
|
294
|
-
env
|
|
295
|
-
|
|
296
|
-
|
|
305
|
+
deploy-list A comma-separated list of deployment IDs
|
|
306
|
+
(e.g., "default-a,default-b").
|
|
307
|
+
env Optional: The environment for deployment
|
|
308
|
+
(e.g., "development", "production").
|
|
309
|
+
Defaults to "development".
|
|
297
310
|
|
|
298
311
|
Options:
|
|
299
|
-
--remove
|
|
300
|
-
|
|
301
|
-
--sync
|
|
302
|
-
|
|
303
|
-
--info-router
|
|
304
|
-
|
|
305
|
-
--expose
|
|
306
|
-
|
|
307
|
-
--info-util
|
|
308
|
-
|
|
309
|
-
--cert
|
|
310
|
-
|
|
311
|
-
--cert-hosts <hosts>
|
|
312
|
-
|
|
313
|
-
--node <node>
|
|
314
|
-
|
|
315
|
-
--build-manifest
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
--replicas <replicas>
|
|
319
|
-
|
|
320
|
-
--image <image>
|
|
321
|
-
--versions <deployment-versions>
|
|
322
|
-
|
|
323
|
-
--traffic <traffic-versions>
|
|
324
|
-
|
|
325
|
-
--disable-update-deployment
|
|
326
|
-
--disable-update-proxy
|
|
327
|
-
--
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
--
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
-
|
|
312
|
+
--remove Deletes specified deployments and their
|
|
313
|
+
associated services.
|
|
314
|
+
--sync Synchronizes deployment environment
|
|
315
|
+
variables, ports, and replica counts.
|
|
316
|
+
--info-router Displays the current router structure and
|
|
317
|
+
configuration.
|
|
318
|
+
--expose Exposes services matching the provided
|
|
319
|
+
deployment ID list.
|
|
320
|
+
--info-util Displays useful `kubectl` utility
|
|
321
|
+
management commands.
|
|
322
|
+
--cert Resets TLS/SSL certificate secrets for
|
|
323
|
+
deployments.
|
|
324
|
+
--cert-hosts <hosts> Resets TLS/SSL certificate secrets for
|
|
325
|
+
specified hosts.
|
|
326
|
+
--node <node> Sets optional node for deployment
|
|
327
|
+
operations.
|
|
328
|
+
--build-manifest Builds Kubernetes YAML manifests,
|
|
329
|
+
including deployments, services, proxies,
|
|
330
|
+
and secrets.
|
|
331
|
+
--replicas <replicas> Sets a custom number of replicas for
|
|
332
|
+
deployments.
|
|
333
|
+
--image <image> Sets a custom image for deployments.
|
|
334
|
+
--versions <deployment-versions> A comma-separated list of custom
|
|
335
|
+
deployment versions.
|
|
336
|
+
--traffic <traffic-versions> A comma-separated list of custom
|
|
337
|
+
deployment traffic weights.
|
|
338
|
+
--disable-update-deployment Disables updates to deployments.
|
|
339
|
+
--disable-update-proxy Disables updates to proxies.
|
|
340
|
+
--disable-deployment-proxy Disables proxies of deployments.
|
|
341
|
+
--disable-update-volume Disables updates to volume mounts during
|
|
342
|
+
deployment.
|
|
343
|
+
--status Retrieves current network traffic data
|
|
344
|
+
from resource deployments and the host
|
|
345
|
+
machine network configuration.
|
|
346
|
+
--kubeadm Enables the kubeadm context for deployment
|
|
347
|
+
operations.
|
|
348
|
+
--etc-hosts Enables the etc-hosts context for
|
|
349
|
+
deployment operations.
|
|
350
|
+
--restore-hosts Restores default `/etc/hosts` entries.
|
|
351
|
+
--disable-update-underpost-config Disables updates to Underpost
|
|
352
|
+
configuration during deployment.
|
|
353
|
+
-h, --help display help for command
|
|
336
354
|
|
|
337
355
|
```
|
|
338
356
|
|
|
@@ -623,7 +641,7 @@ Options:
|
|
|
623
641
|
Runs a script from the specified path.
|
|
624
642
|
|
|
625
643
|
Arguments:
|
|
626
|
-
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, ssh-cluster-info, dev-hosts-expose, dev-hosts-restore, cluster-build, template-deploy, template-deploy-image, clean, pull, release-deploy, ssh-deploy, ide, sync, tz, cron, ls-deployments, ls-images, host-update,
|
|
644
|
+
runner-id The runner ID to run. Options: spark-template, rmi, kill, secret, underpost-config, gpu-env, tf-gpu-test, dev-cluster, metadata, svc-ls, svc-rm, ssh-cluster-info, dev-hosts-expose, dev-hosts-restore, cluster-build, template-deploy, template-deploy-image, clean, pull, release-deploy, ssh-deploy, ide, sync, tz, cron, ls-deployments, ls-images, host-update, dd-container, monitor, db-client, git-conf, promote, metrics, cluster, deploy, dev, service, sh, log, release-cmt, sync-replica, tf-vae-test, deploy-job.
|
|
627
645
|
path The absolute or relative directory path where the script is located.
|
|
628
646
|
|
|
629
647
|
Options:
|
|
@@ -632,13 +650,24 @@ Options:
|
|
|
632
650
|
--dev Sets the development context environment for the script.
|
|
633
651
|
--build Set builder context runner
|
|
634
652
|
--replicas <replicas> Sets a custom number of replicas for deployment.
|
|
635
|
-
--pod-name <pod-name> Optional: Specifies the pod name for
|
|
653
|
+
--pod-name <pod-name> Optional: Specifies the pod name for execution.
|
|
654
|
+
--node-name <node-name> Optional: Specifies the node name for execution.
|
|
655
|
+
--port <port> Optional: Specifies the port for execution.
|
|
656
|
+
--etc-hosts Enables etc-hosts context for the runner execution.
|
|
636
657
|
--volume-host-path <volume-host-path> Optional: Specifies the volume host path for test execution.
|
|
637
658
|
--volume-mount-path <volume-mount-path> Optional: Specifies the volume mount path for test execution.
|
|
638
659
|
--volume-type <volume-type> Optional: Specifies the volume type for test execution.
|
|
639
660
|
--image-name <image-name> Optional: Specifies the image name for test execution.
|
|
640
661
|
--container-name <container-name> Optional: Specifies the container name for test execution.
|
|
641
662
|
--namespace <namespace> Optional: Specifies the namespace for test execution.
|
|
663
|
+
--tty Enables TTY for the container in deploy-job.
|
|
664
|
+
--stdin Keeps STDIN open for the container in deploy-job.
|
|
665
|
+
--restart-policy <policy> Sets the restart policy for the job in deploy-job.
|
|
666
|
+
--runtime-class-name <name> Sets the runtime class name for the job in deploy-job.
|
|
667
|
+
--image-pull-policy <policy> Sets the image pull policy for the job in deploy-job.
|
|
668
|
+
--api-version <version> Sets the API version for the job manifest in deploy-job.
|
|
669
|
+
--claim-name <name> Optional: Specifies the claim name for volume mounting in deploy-job.
|
|
670
|
+
--kind <kind-type> Specifies the kind of Kubernetes resource (e.g., Job, Deployment) for deploy-job.
|
|
642
671
|
--kubeadm Flag to indicate Kubeadm cluster type context
|
|
643
672
|
--k3s Flag to indicate K3s cluster type context
|
|
644
673
|
--force Forces operation, overriding any warnings or conflicts.
|
|
@@ -647,6 +676,7 @@ Options:
|
|
|
647
676
|
--terminal Enables terminal mode for interactive script execution.
|
|
648
677
|
--dev-proxy-port-offset <port-offset> Sets a custom port offset for development proxy.
|
|
649
678
|
--conf-server-path <conf-server-path> Sets a custom configuration server path.
|
|
679
|
+
--underpost-root <underpost-root> Sets a custom Underpost root path.
|
|
650
680
|
-h, --help display help for command
|
|
651
681
|
|
|
652
682
|
```
|
|
@@ -733,4 +763,3 @@ Options:
|
|
|
733
763
|
-h, --help display help for command
|
|
734
764
|
|
|
735
765
|
```
|
|
736
|
-
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-default-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.89.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.89.21
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "124Ki"
|
|
@@ -100,7 +100,7 @@ spec:
|
|
|
100
100
|
spec:
|
|
101
101
|
containers:
|
|
102
102
|
- name: dd-default-development-green
|
|
103
|
-
image: localhost/rockylinux9-underpost:v2.89.
|
|
103
|
+
image: localhost/rockylinux9-underpost:v2.89.21
|
|
104
104
|
# resources:
|
|
105
105
|
# requests:
|
|
106
106
|
# memory: "124Ki"
|
|
@@ -17,7 +17,7 @@ spec:
|
|
|
17
17
|
spec:
|
|
18
18
|
containers:
|
|
19
19
|
- name: dd-test-development-blue
|
|
20
|
-
image: localhost/rockylinux9-underpost:v2.89.
|
|
20
|
+
image: localhost/rockylinux9-underpost:v2.89.21
|
|
21
21
|
# resources:
|
|
22
22
|
# requests:
|
|
23
23
|
# memory: "96294Ki"
|
|
@@ -33,13 +33,17 @@ spec:
|
|
|
33
33
|
npm install -g underpost &&
|
|
34
34
|
underpost secret underpost --create-from-file /etc/config/.env.development &&
|
|
35
35
|
underpost start --build --run dd-test development
|
|
36
|
+
|
|
36
37
|
volumeMounts:
|
|
37
38
|
- name: config-volume
|
|
38
39
|
mountPath: /etc/config
|
|
40
|
+
|
|
39
41
|
volumes:
|
|
40
42
|
- name: config-volume
|
|
41
43
|
configMap:
|
|
42
44
|
name: underpost-config
|
|
45
|
+
|
|
46
|
+
|
|
43
47
|
---
|
|
44
48
|
apiVersion: v1
|
|
45
49
|
kind: Service
|
|
@@ -104,7 +108,7 @@ spec:
|
|
|
104
108
|
spec:
|
|
105
109
|
containers:
|
|
106
110
|
- name: dd-test-development-green
|
|
107
|
-
image: localhost/rockylinux9-underpost:v2.89.
|
|
111
|
+
image: localhost/rockylinux9-underpost:v2.89.21
|
|
108
112
|
# resources:
|
|
109
113
|
# requests:
|
|
110
114
|
# memory: "96294Ki"
|
|
@@ -120,13 +124,17 @@ spec:
|
|
|
120
124
|
npm install -g underpost &&
|
|
121
125
|
underpost secret underpost --create-from-file /etc/config/.env.development &&
|
|
122
126
|
underpost start --build --run dd-test development
|
|
127
|
+
|
|
123
128
|
volumeMounts:
|
|
124
129
|
- name: config-volume
|
|
125
130
|
mountPath: /etc/config
|
|
131
|
+
|
|
126
132
|
volumes:
|
|
127
133
|
- name: config-volume
|
|
128
134
|
configMap:
|
|
129
135
|
name: underpost-config
|
|
136
|
+
|
|
137
|
+
|
|
130
138
|
---
|
|
131
139
|
apiVersion: v1
|
|
132
140
|
kind: Service
|
|
@@ -10,6 +10,7 @@ spec:
|
|
|
10
10
|
routes:
|
|
11
11
|
- conditions:
|
|
12
12
|
- prefix: /
|
|
13
|
+
|
|
13
14
|
enableWebsockets: true
|
|
14
15
|
services:
|
|
15
16
|
- name: dd-test-development-blue-service
|
|
@@ -18,6 +19,7 @@ spec:
|
|
|
18
19
|
|
|
19
20
|
- conditions:
|
|
20
21
|
- prefix: /peer
|
|
22
|
+
|
|
21
23
|
enableWebsockets: true
|
|
22
24
|
services:
|
|
23
25
|
- name: dd-test-development-blue-service
|
|
@@ -35,6 +37,7 @@ spec:
|
|
|
35
37
|
routes:
|
|
36
38
|
- conditions:
|
|
37
39
|
- prefix: /
|
|
40
|
+
|
|
38
41
|
enableWebsockets: true
|
|
39
42
|
services:
|
|
40
43
|
- name: dd-test-development-blue-service
|
|
@@ -43,6 +46,7 @@ spec:
|
|
|
43
46
|
|
|
44
47
|
- conditions:
|
|
45
48
|
- prefix: /peer
|
|
49
|
+
|
|
46
50
|
enableWebsockets: true
|
|
47
51
|
services:
|
|
48
52
|
- name: dd-test-development-blue-service
|
|
@@ -21,6 +21,13 @@ spec:
|
|
|
21
21
|
containers:
|
|
22
22
|
- name: grafana
|
|
23
23
|
image: grafana/grafana:latest
|
|
24
|
+
env:
|
|
25
|
+
# - name: GF_SERVER_ROOT_URL
|
|
26
|
+
# value: '{{GF_SERVER_ROOT_URL}}'
|
|
27
|
+
- name: GF_SERVER_ROOT_URL
|
|
28
|
+
value: '/grafana'
|
|
29
|
+
- name: GF_SERVER_SERVE_FROM_SUB_PATH
|
|
30
|
+
value: 'true'
|
|
24
31
|
imagePullPolicy: IfNotPresent
|
|
25
32
|
ports:
|
|
26
33
|
- containerPort: 3000
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
apiVersion: storage.k8s.io/v1
|
|
2
|
+
kind: StorageClass
|
|
3
|
+
metadata:
|
|
4
|
+
name: grafana-storage-class
|
|
5
|
+
annotations:
|
|
6
|
+
storageclass.kubernetes.io/is-default-class: 'false'
|
|
7
|
+
provisioner: rancher.io/local-path
|
|
8
|
+
reclaimPolicy: Retain
|
|
9
|
+
volumeBindingMode: WaitForFirstConsumer
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: PersistentVolume
|
|
3
|
+
metadata:
|
|
4
|
+
name: pv-dd
|
|
5
|
+
spec:
|
|
6
|
+
capacity:
|
|
7
|
+
storage: 5Gi
|
|
8
|
+
accessModes:
|
|
9
|
+
- ReadWriteOnce
|
|
10
|
+
persistentVolumeReclaimPolicy: Retain
|
|
11
|
+
storageClassName: manual
|
|
12
|
+
hostPath:
|
|
13
|
+
path: /home/dd
|
|
14
|
+
type: DirectoryOrCreate
|
|
15
|
+
nodeAffinity:
|
|
16
|
+
required:
|
|
17
|
+
nodeSelectorTerms:
|
|
18
|
+
- matchExpressions:
|
|
19
|
+
- key: kubernetes.io/hostname
|
|
20
|
+
operator: In
|
|
21
|
+
values:
|
|
22
|
+
- localhost
|
|
23
|
+
---
|
|
24
|
+
apiVersion: v1
|
|
25
|
+
kind: PersistentVolumeClaim
|
|
26
|
+
metadata:
|
|
27
|
+
name: pvc-dd
|
|
28
|
+
spec:
|
|
29
|
+
accessModes:
|
|
30
|
+
- ReadWriteOnce
|
|
31
|
+
storageClassName: manual
|
|
32
|
+
resources:
|
|
33
|
+
requests:
|
|
34
|
+
storage: 1Gi
|
package/package.json
CHANGED
package/src/cli/cluster.js
CHANGED
|
@@ -58,6 +58,8 @@ class UnderpostCluster {
|
|
|
58
58
|
* @param {boolean} [options.config=false] - Apply general host configuration (SELinux, containerd, sysctl, firewalld).
|
|
59
59
|
* @param {boolean} [options.worker=false] - Configure as a worker node (for Kubeadm or K3s join).
|
|
60
60
|
* @param {boolean} [options.chown=false] - Set up kubectl configuration for the current user.
|
|
61
|
+
* @param {boolean} [options.removeVolumeHostPaths=false] - Remove data from host paths used by Persistent Volumes.
|
|
62
|
+
* @param {string} [options.hosts] - Set custom hosts entries.
|
|
61
63
|
* @memberof UnderpostCluster
|
|
62
64
|
*/
|
|
63
65
|
async init(
|
|
@@ -90,6 +92,8 @@ class UnderpostCluster {
|
|
|
90
92
|
config: false,
|
|
91
93
|
worker: false,
|
|
92
94
|
chown: false,
|
|
95
|
+
removeVolumeHostPaths: false,
|
|
96
|
+
hosts: '',
|
|
93
97
|
},
|
|
94
98
|
) {
|
|
95
99
|
// Handles initial host setup (installing docker, podman, kind, kubeadm, helm)
|
|
@@ -151,7 +155,11 @@ class UnderpostCluster {
|
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
// Reset Kubernetes cluster components (Kind/Kubeadm/K3s) and container runtimes
|
|
154
|
-
if (options.reset === true)
|
|
158
|
+
if (options.reset === true)
|
|
159
|
+
return await UnderpostCluster.API.safeReset({
|
|
160
|
+
underpostRoot,
|
|
161
|
+
removeVolumeHostPaths: options.removeVolumeHostPaths,
|
|
162
|
+
});
|
|
155
163
|
|
|
156
164
|
// Check if a cluster (Kind, Kubeadm, or K3s) is already initialized
|
|
157
165
|
const alreadyKubeadmCluster = UnderpostDeploy.API.get('calico-kube-controllers')[0];
|
|
@@ -280,6 +288,14 @@ class UnderpostCluster {
|
|
|
280
288
|
if (options.grafana === true) {
|
|
281
289
|
shellExec(`kubectl delete deployment grafana --ignore-not-found`);
|
|
282
290
|
shellExec(`kubectl apply -k ${underpostRoot}/manifests/grafana`);
|
|
291
|
+
const yaml = `${fs
|
|
292
|
+
.readFileSync(`${underpostRoot}/manifests/grafana/deployment.yaml`, 'utf8')
|
|
293
|
+
.replace('{{GF_SERVER_ROOT_URL}}', options.hosts.split(',')[0])}`;
|
|
294
|
+
console.log(yaml);
|
|
295
|
+
shellExec(`kubectl apply -f - <<EOF
|
|
296
|
+
${yaml}
|
|
297
|
+
EOF
|
|
298
|
+
`);
|
|
283
299
|
}
|
|
284
300
|
|
|
285
301
|
if (options.prom && typeof options.prom === 'string') {
|
|
@@ -575,9 +591,10 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
|
|
|
575
591
|
* in coredns) by restoring SELinux security contexts and safely cleaning up cluster artifacts.
|
|
576
592
|
* @param {object} [options] - Configuration options for the reset.
|
|
577
593
|
* @param {string} [options.underpostRoot] - The root path of the underpost project.
|
|
594
|
+
* @param {boolean} [options.removeVolumeHostPaths=false] - Whether to remove data from host paths used by Persistent Volumes.
|
|
578
595
|
* @memberof UnderpostCluster
|
|
579
596
|
*/
|
|
580
|
-
async safeReset(options = { underpostRoot: '.' }) {
|
|
597
|
+
async safeReset(options = { underpostRoot: '.', removeVolumeHostPaths: false }) {
|
|
581
598
|
logger.info('Starting a safe and comprehensive reset of Kubernetes and container environments...');
|
|
582
599
|
|
|
583
600
|
try {
|
|
@@ -604,25 +621,30 @@ net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`,
|
|
|
604
621
|
// Phase 1: Clean up Persistent Volumes with hostPath
|
|
605
622
|
// This targets data created by Kubernetes Persistent Volumes that use hostPath.
|
|
606
623
|
logger.info('Phase 1/7: Cleaning Kubernetes hostPath volumes...');
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
624
|
+
if (options.removeVolumeHostPaths)
|
|
625
|
+
try {
|
|
626
|
+
const pvListJson = shellExec(`kubectl get pv -o json || echo '{"items":[]}'`, {
|
|
627
|
+
stdout: true,
|
|
628
|
+
silent: true,
|
|
629
|
+
});
|
|
630
|
+
const pvList = JSON.parse(pvListJson);
|
|
631
|
+
|
|
632
|
+
if (pvList.items && pvList.items.length > 0) {
|
|
633
|
+
for (const pv of pvList.items) {
|
|
634
|
+
// Check if the PV uses hostPath and delete its contents
|
|
635
|
+
if (pv.spec.hostPath && pv.spec.hostPath.path) {
|
|
636
|
+
const hostPath = pv.spec.hostPath.path;
|
|
637
|
+
logger.info(`Removing data from host path for PV '${pv.metadata.name}': ${hostPath}`);
|
|
638
|
+
shellExec(`sudo rm -rf ${hostPath}/* || true`);
|
|
639
|
+
}
|
|
618
640
|
}
|
|
641
|
+
} else {
|
|
642
|
+
logger.info('No Persistent Volumes found with hostPath to clean up.');
|
|
619
643
|
}
|
|
620
|
-
}
|
|
621
|
-
logger.
|
|
644
|
+
} catch (error) {
|
|
645
|
+
logger.error('Failed to clean up Persistent Volumes:', error);
|
|
622
646
|
}
|
|
623
|
-
|
|
624
|
-
logger.error('Failed to clean up Persistent Volumes:', error);
|
|
625
|
-
}
|
|
647
|
+
else logger.info(' -> Skipping hostPath volume cleanup as per configuration.');
|
|
626
648
|
// Phase 2: Restore SELinux and stop services
|
|
627
649
|
// This is critical for fixing the 'permission denied' error you experienced.
|
|
628
650
|
// Enable SELinux permissive mode and restore file contexts.
|