underpost 2.89.44 → 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.
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <!-- badges -->
20
20
 
21
- [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.89.44)](https://socket.dev/npm/package/underpost/overview/2.89.44) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](https://www.npmjs.com/package/underpost)
21
+ [![Node.js CI](https://github.com/underpostnet/engine/actions/workflows/docker-image.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/docker-image.yml) [![Test](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml/badge.svg?branch=master)](https://github.com/underpostnet/engine/actions/workflows/coverall.ci.yml) [![Downloads](https://img.shields.io/npm/dm/underpost.svg)](https://www.npmjs.com/package/underpost) [![Socket Badge](https://socket.dev/api/badge/npm/package/underpost/2.89.45)](https://socket.dev/npm/package/underpost/overview/2.89.45) [![Coverage Status](https://coveralls.io/repos/github/underpostnet/engine/badge.svg?branch=master)](https://coveralls.io/github/underpostnet/engine?branch=master) [![Version](https://img.shields.io/npm/v/underpost.svg)](https://www.npmjs.org/package/underpost) [![License](https://img.shields.io/npm/l/underpost.svg)](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.44
69
+ ## underpost ci/cd cli v2.89.45
70
70
 
71
71
  ### Usage: `underpost [options] [command]`
72
72
  ```
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.89.44
1
+ ## underpost ci/cd cli v2.89.45
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -245,69 +245,79 @@ Options:
245
245
  Manages Kubernetes clusters, defaulting to Kind cluster initialization.
246
246
 
247
247
  Arguments:
248
- pod-name Optional: Filters information by a specific pod
249
- name.
248
+ pod-name Optional: Filters information by a
249
+ specific pod name.
250
250
 
251
251
  Options:
252
- --reset Deletes all clusters and prunes all related data
253
- and caches.
254
- --mariadb Initializes the cluster with a MariaDB
255
- statefulset.
256
- --mysql Initializes the cluster with a MySQL statefulset.
257
- --mongodb Initializes the cluster with a MongoDB
258
- statefulset.
259
- --mongo-db-host <host> Set custom mongo db host
260
- --postgresql Initializes the cluster with a PostgreSQL
261
- statefulset.
262
- --mongodb4 Initializes the cluster with a MongoDB 4.4
263
- service.
264
- --valkey Initializes the cluster with a Valkey service.
265
- --contour Initializes the cluster with Project Contour base
266
- HTTPProxy and Envoy.
267
- --cert-manager Initializes the cluster with a Let's Encrypt
268
- production ClusterIssuer.
269
- --dedicated-gpu Initializes the cluster with dedicated GPU base
270
- resources and environment settings.
271
- --info Retrieves information about all deployed
272
- Kubernetes objects.
273
- --full Initializes the cluster with all available
274
- statefulsets and services.
275
- --ns-use <ns-name> Switches the current Kubernetes context to the
276
- specified namespace (creates if it doesn't
277
- exist).
278
- --kubeadm Initializes the cluster using kubeadm for control
279
- plane management.
280
- --grafana Initializes the cluster with a Grafana
281
- deployment.
282
- --prom [hosts] Initializes the cluster with a Prometheus
283
- Operator deployment and monitor scrap for
284
- specified hosts.
285
- --dev Initializes a development-specific cluster
286
- configuration.
287
- --list-pods Displays detailed information about all pods.
288
- --info-capacity Displays the current total machine capacity
289
- information.
290
- --info-capacity-pod Displays the current machine capacity information
291
- per pod.
292
- --pull-image Sets an optional associated image to pull during
293
- initialization.
294
- --init-host Installs necessary Kubernetes node CLI tools
295
- (e.g., kind, kubeadm, docker, podman, helm).
296
- --uninstall-host Uninstalls all host components installed by
297
- init-host.
298
- --config Sets the base Kubernetes node configuration.
299
- --worker Sets the context for a worker node.
300
- --chown Sets the appropriate ownership for Kubernetes
301
- kubeconfig files.
302
- --k3s Initializes the cluster using K3s (Lightweight
303
- Kubernetes).
304
- --hosts <hosts> A comma-separated list of cluster hostnames or IP
305
- addresses.
306
- --remove-volume-host-paths Removes specified volume host paths after
307
- execution.
308
- --namespace <namespace> Kubernetes namespace for cluster operations
309
- (defaults to "default").
310
- -h, --help display help for command
252
+ --reset Deletes all clusters and prunes all
253
+ related data and caches.
254
+ --mariadb Initializes the cluster with a MariaDB
255
+ statefulset.
256
+ --mysql Initializes the cluster with a MySQL
257
+ statefulset.
258
+ --mongodb Initializes the cluster with a MongoDB
259
+ statefulset.
260
+ --mongo-db-host <host> Set custom mongo db host
261
+ --postgresql Initializes the cluster with a
262
+ PostgreSQL statefulset.
263
+ --mongodb4 Initializes the cluster with a MongoDB
264
+ 4.4 service.
265
+ --valkey Initializes the cluster with a Valkey
266
+ service.
267
+ --contour Initializes the cluster with Project
268
+ Contour base HTTPProxy and Envoy.
269
+ --cert-manager Initializes the cluster with a Let's
270
+ Encrypt production ClusterIssuer.
271
+ --dedicated-gpu Initializes the cluster with dedicated
272
+ GPU base resources and environment
273
+ settings.
274
+ --full Initializes the cluster with all
275
+ available statefulsets and services.
276
+ --ns-use <ns-name> Switches the current Kubernetes context
277
+ to the specified namespace (creates if
278
+ it doesn't exist).
279
+ --kubeadm Initializes the cluster using kubeadm
280
+ for control plane management.
281
+ --pod-network-cidr <cidr> Sets custom pod network CIDR for kubeadm
282
+ cluster initialization (defaults to
283
+ "192.168.0.0/16").
284
+ --control-plane-endpoint <endpoint> Sets custom control plane endpoint for
285
+ kubeadm cluster initialization (defaults
286
+ to "localhost:6443").
287
+ --grafana Initializes the cluster with a Grafana
288
+ deployment.
289
+ --prom [hosts] Initializes the cluster with a
290
+ Prometheus Operator deployment and
291
+ monitor scrap for specified hosts.
292
+ --dev Initializes a development-specific
293
+ cluster configuration.
294
+ --list-pods Displays detailed information about all
295
+ pods.
296
+ --info-capacity Displays the current total machine
297
+ capacity information.
298
+ --info-capacity-pod Displays the current machine capacity
299
+ information per pod.
300
+ --pull-image Sets an optional associated image to
301
+ pull during initialization.
302
+ --init-host Installs necessary Kubernetes node CLI
303
+ tools (e.g., kind, kubeadm, docker,
304
+ podman, helm).
305
+ --uninstall-host Uninstalls all host components installed
306
+ by init-host.
307
+ --config Sets the base Kubernetes node
308
+ configuration.
309
+ --worker Sets the context for a worker node.
310
+ --chown Sets the appropriate ownership for
311
+ Kubernetes kubeconfig files.
312
+ --k3s Initializes the cluster using K3s
313
+ (Lightweight Kubernetes).
314
+ --hosts <hosts> A comma-separated list of cluster
315
+ hostnames or IP addresses.
316
+ --remove-volume-host-paths Removes specified volume host paths
317
+ after execution.
318
+ --namespace <namespace> Kubernetes namespace for cluster
319
+ operations (defaults to "default").
320
+ -h, --help display help for command
311
321
 
312
322
  ```
313
323
 
@@ -334,8 +344,6 @@ Options:
334
344
  configuration.
335
345
  --expose Exposes services matching the provided
336
346
  deployment ID list.
337
- --info-util Displays useful `kubectl` utility
338
- management commands.
339
347
  --cert Resets TLS/SSL certificate secrets for
340
348
  deployments.
341
349
  --cert-hosts <hosts> Resets TLS/SSL certificate secrets for
@@ -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.44
20
+ image: localhost/rockylinux9-underpost:v2.89.45
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.44
103
+ image: localhost/rockylinux9-underpost:v2.89.45
104
104
  # resources:
105
105
  # requests:
106
106
  # memory: "124Ki"
@@ -18,7 +18,7 @@ spec:
18
18
  spec:
19
19
  containers:
20
20
  - name: dd-test-development-blue
21
- image: localhost/rockylinux9-underpost:v2.89.44
21
+ image: localhost/rockylinux9-underpost:v2.89.45
22
22
  # resources:
23
23
  # requests:
24
24
  # memory: "96294Ki"
@@ -111,7 +111,7 @@ spec:
111
111
  spec:
112
112
  containers:
113
113
  - name: dd-test-development-green
114
- image: localhost/rockylinux9-underpost:v2.89.44
114
+ image: localhost/rockylinux9-underpost:v2.89.45
115
115
  # resources:
116
116
  # requests:
117
117
  # memory: "96294Ki"
@@ -1,4 +1,4 @@
1
- apiVersion: projectcalico.org/v3
1
+ apiVersion: crd.projectcalico.org/v1
2
2
  kind: GlobalNetworkPolicy
3
3
  metadata:
4
4
  name: allow-all-egress-cluster
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.89.44",
5
+ "version": "2.89.45",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
@@ -51,6 +51,8 @@ class UnderpostCluster {
51
51
  * @param {boolean} [options.pullImage=false] - Pull necessary Docker images before deployment.
52
52
  * @param {boolean} [options.dedicatedGpu=false] - Configure for dedicated GPU usage (e.g., NVIDIA GPU Operator).
53
53
  * @param {boolean} [options.kubeadm=false] - Initialize the cluster using Kubeadm.
54
+ * @param {string} [options.podNetworkCidr='192.168.0.0/16'] - Custom pod network CIDR for Kubeadm cluster initialization. Defaults to '192.168.0.0/16'.
55
+ * @param {string} [options.controlPlaneEndpoint=''] - Custom control plane endpoint for Kubeadm cluster initialization. Defaults to '${os.hostname()}:6443'.
54
56
  * @param {boolean} [options.k3s=false] - Initialize the cluster using K3s.
55
57
  * @param {boolean} [options.initHost=false] - Perform initial host setup (install Docker, Podman, Kind, Kubeadm, Helm).
56
58
  * @param {boolean} [options.grafana=false] - Initialize the cluster with a Grafana deployment.
@@ -86,6 +88,8 @@ class UnderpostCluster {
86
88
  pullImage: false,
87
89
  dedicatedGpu: false,
88
90
  kubeadm: false,
91
+ podNetworkCidr: '192.168.0.0/16',
92
+ controlPlaneEndpoint: '',
89
93
  k3s: false,
90
94
  initHost: false,
91
95
  grafana: false,
@@ -140,39 +144,6 @@ class UnderpostCluster {
140
144
  logger.info(`Context switched to namespace: ${options.nsUse}`);
141
145
  return;
142
146
  }
143
- if (options.info === true) {
144
- shellExec(`kubectl config get-contexts`);
145
- shellExec(`kubectl config get-clusters`);
146
- shellExec(`kubectl get nodes -o wide`);
147
- shellExec(`kubectl config view | grep namespace`);
148
- shellExec(`kubectl get ns -o wide`);
149
- shellExec(`kubectl get pvc --all-namespaces -o wide`);
150
- shellExec(`kubectl get pv --all-namespaces -o wide`);
151
- shellExec(`kubectl get cronjob --all-namespaces -o wide`);
152
- shellExec(`kubectl get svc --all-namespaces -o wide`);
153
- shellExec(`kubectl get statefulsets --all-namespaces -o wide`);
154
- shellExec(`kubectl get deployments --all-namespaces -o wide`);
155
- shellExec(`kubectl get configmap --all-namespaces -o wide`);
156
- shellExec(`kubectl get pods --all-namespaces -o wide`);
157
- shellExec(
158
- `kubectl get pod --all-namespaces -o="custom-columns=NAME:.metadata.name,INIT-CONTAINERS:.spec.initContainers[*].name,CONTAINERS:.spec.containers[*].name"`,
159
- );
160
- shellExec(
161
- `kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\\n"}{.metadata.name}{":\\t"}{range .spec.containers[*]}{.image}{", "}{end}{end}'`,
162
- );
163
- shellExec(`sudo crictl images`);
164
- console.log();
165
- logger.info('contour -------------------------------------------------');
166
- for (const _k of ['Cluster', 'HTTPProxy', 'ClusterIssuer', 'Certificate']) {
167
- shellExec(`kubectl get ${_k} --all-namespaces -o wide`);
168
- }
169
- logger.info('----------------------------------------------------------------');
170
- shellExec(`kubectl get secrets --all-namespaces -o wide`);
171
- shellExec(`docker secret ls`);
172
- shellExec(`kubectl get crd --all-namespaces -o wide`);
173
- shellExec(`sudo kubectl api-resources`);
174
- return;
175
- }
176
147
 
177
148
  // Reset Kubernetes cluster components (Kind/Kubeadm/K3s) and container runtimes
178
149
  if (options.reset === true)
@@ -250,9 +221,13 @@ class UnderpostCluster {
250
221
  logger.info('K3s comes with local-path-provisioner by default. Skipping explicit installation.');
251
222
  } else if (options.kubeadm === true) {
252
223
  logger.info('Initializing Kubeadm control plane...');
224
+ // Set default values if not provided
225
+ const podNetworkCidr = options.podNetworkCidr || '192.168.0.0/16';
226
+ const controlPlaneEndpoint = options.controlPlaneEndpoint || `${os.hostname()}:6443`;
227
+
253
228
  // Initialize kubeadm control plane
254
229
  shellExec(
255
- `sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --control-plane-endpoint="${os.hostname()}:6443"`,
230
+ `sudo kubeadm init --pod-network-cidr=${podNetworkCidr} --control-plane-endpoint="${controlPlaneEndpoint}"`,
256
231
  );
257
232
  // Configure kubectl for the current user
258
233
  UnderpostCluster.API.chown('kubeadm'); // Pass 'kubeadm' to chown
@@ -263,8 +238,9 @@ class UnderpostCluster {
263
238
  `sudo kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.3/manifests/tigera-operator.yaml`,
264
239
  );
265
240
  shellExec(
266
- `sudo kubectl apply -f ${underpostRoot}/manifests/kubeadm-calico-config.yaml -n ${options.namespace}`,
241
+ `kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.3/manifests/custom-resources.yaml`,
267
242
  );
243
+ shellExec(`sudo kubectl apply -f ${underpostRoot}/manifests/kubeadm-calico-config.yaml`);
268
244
 
269
245
  // Untaint control plane node to allow scheduling pods
270
246
  const nodeName = os.hostname();
@@ -272,7 +248,7 @@ class UnderpostCluster {
272
248
  // Install local-path-provisioner for dynamic PVCs (optional but recommended)
273
249
  logger.info('Installing local-path-provisioner...');
274
250
  shellExec(
275
- `kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml -n ${options.namespace}`,
251
+ `kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml`,
276
252
  );
277
253
  } else {
278
254
  // Kind cluster initialization (if not using kubeadm or k3s)
@@ -479,7 +455,7 @@ EOF
479
455
  }
480
456
 
481
457
  if (options.full === true || options.contour === true) {
482
- shellExec(`kubectl apply -f https://projectcontour.io/quickstart/contour.yaml -n ${options.namespace}`);
458
+ shellExec(`kubectl apply -f https://projectcontour.io/quickstart/contour.yaml`);
483
459
  if (options.kubeadm === true) {
484
460
  // Envoy service might need NodePort for kubeadm
485
461
  shellExec(
package/src/cli/deploy.js CHANGED
@@ -417,68 +417,6 @@ spec:
417
417
  namespace: '',
418
418
  },
419
419
  ) {
420
- if (options.infoUtil === true)
421
- return logger.info(`
422
- kubectl rollout restart deployment/deployment-name
423
- kubectl rollout undo deployment/deployment-name
424
- kubectl scale statefulsets <stateful-set-name> --replicas=<new-replicas>
425
- kubectl get pods -w
426
- kubectl patch statefulset valkey-service --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"valkey/valkey:latest"}]'
427
- kubectl patch statefulset valkey-service -p '{"spec":{"template":{"spec":{"containers":[{"name":"valkey-service","imagePullPolicy":"Never"}]}}}}'
428
- kubectl logs -f <pod-name>
429
- kubectl describe pod <pod-name>
430
- kubectl exec -it <pod-name> -- bash
431
- kubectl exec -it <pod-name> -- sh
432
- docker exec -it kind-control-plane bash
433
- curl -4 -v google.com
434
- kubectl taint nodes <node-name> node-role.kubernetes.io/control-plane:NoSchedule-
435
- kubectl run test-pod --image=busybox:latest --restart=Never -- /bin/sh -c "while true; do sleep 30; done;"
436
- kubectl run test-pod --image=alpine/curl:latest --restart=Never -- sh -c "sleep infinity"
437
- kubectl get ippools -o yaml
438
- kubectl get node <node-name> -o jsonpath='{.spec.podCIDR}'
439
- kubectl patch ippool default-ipv4-ippool --type='json' -p='[{"op": "replace", "path": "/spec/cidr", "value": "10.244.0.0/16"}]'
440
- kubectl patch ippool default-ipv4-ippool --type='json' -p='[{"op": "replace", "path": "/spec/cidr", "value": "192.168.0.0/24"}]'
441
- sudo podman run --rm localhost/<image-name>:<image-version> <command>
442
- kubectl get configmap kubelet-config -n kube-system -o yaml > kubelet-config.yaml
443
- kubectl -n kube-system rollout restart daemonset kube-proxy
444
- kubectl get EndpointSlice -o wide --all-namespaces -w
445
- kubectl apply -k manifests/deployment/adminer/.
446
- kubectl wait --for=condition=Ready pod/busybox1
447
- kubectl wait --for=jsonpath='{.status.phase}'=Running pod/busybox1
448
- kubectl wait --for='jsonpath={.status.conditions[?(@.type=="Ready")].status}=True' pod/busybox1
449
- kubectl wait --for=delete pod/busybox1 --timeout=60s
450
-
451
- node bin run cluster-build
452
- node bin run template-deploy
453
- node bin run ssh-deploy (sync-)engine-core
454
- node bin run cluster --dev 'express,dd-test+dd-core'
455
- node bin run dd-container --dev
456
- node bin run promote dd-default production
457
- node bin dockerfile-pull-base-images --dev --path 'image-path' --kind-load
458
- node bin/deploy update-default-conf <deploy-id>
459
-
460
- fqdn: <service>.<namespace>.<kind(svc/pod)>.<cluster-domain(cluster.local)>
461
- kubectl run --rm -it test-dns --image=busybox:latest --restart=Never -- /bin/sh -c "
462
- nslookup kubernetes.default.svc.cluster.local;
463
- nslookup mongodb-service.default.svc.cluster.local;
464
- nslookup valkey-service.default.svc.cluster.local;
465
- nc -vz mongodb-service 27017;
466
- nc -vz valkey-service 6379;
467
- echo exit code: \\\$?
468
- "
469
-
470
- kubectl apply -f - <<EOF
471
- apiVersion: apps/v1
472
- kind: StatefulSet
473
- metadata:
474
- name: ...
475
- EOF
476
-
477
- https://org.ngc.nvidia.com/setup/api-keys
478
- docker login nvcr.io
479
- Username: $oauthtoken
480
- Password: <Your Key>
481
- `);
482
420
  const namespace = options.namespace ? options.namespace : 'default';
483
421
  if (!deployList && options.certHosts) {
484
422
  for (const host of options.certHosts.split(',')) {
package/src/cli/index.js CHANGED
@@ -156,13 +156,20 @@ program
156
156
  .option('--contour', 'Initializes the cluster with Project Contour base HTTPProxy and Envoy.')
157
157
  .option('--cert-manager', "Initializes the cluster with a Let's Encrypt production ClusterIssuer.")
158
158
  .option('--dedicated-gpu', 'Initializes the cluster with dedicated GPU base resources and environment settings.')
159
- .option('--info', 'Retrieves information about all deployed Kubernetes objects.')
160
159
  .option('--full', 'Initializes the cluster with all available statefulsets and services.')
161
160
  .option(
162
161
  '--ns-use <ns-name>',
163
162
  "Switches the current Kubernetes context to the specified namespace (creates if it doesn't exist).",
164
163
  )
165
164
  .option('--kubeadm', 'Initializes the cluster using kubeadm for control plane management.')
165
+ .option(
166
+ '--pod-network-cidr <cidr>',
167
+ 'Sets custom pod network CIDR for kubeadm cluster initialization (defaults to "192.168.0.0/16").',
168
+ )
169
+ .option(
170
+ '--control-plane-endpoint <endpoint>',
171
+ 'Sets custom control plane endpoint for kubeadm cluster initialization (defaults to "localhost:6443").',
172
+ )
166
173
  .option('--grafana', 'Initializes the cluster with a Grafana deployment.')
167
174
  .option(
168
175
  '--prom [hosts]',
@@ -197,7 +204,6 @@ program
197
204
  .option('--sync', 'Synchronizes deployment environment variables, ports, and replica counts.')
198
205
  .option('--info-router', 'Displays the current router structure and configuration.')
199
206
  .option('--expose', 'Exposes services matching the provided deployment ID list.')
200
- .option('--info-util', 'Displays useful `kubectl` utility management commands.')
201
207
  .option('--cert', 'Resets TLS/SSL certificate secrets for deployments.')
202
208
  .option('--cert-hosts <hosts>', 'Resets TLS/SSL certificate secrets for specified hosts.')
203
209
  .option('--node <node>', 'Sets optional node for deployment operations.')
@@ -39,6 +39,7 @@ class UnderpostMonitor {
39
39
  * @param {string} [options.type=''] - Type of deployment (e.g., 'blue-green', 'remote').
40
40
  * @param {string} [options.replicas=''] - Number of replicas for the deployment.
41
41
  * @param {boolean} [options.sync=false] - Synchronize traffic switching with the deployment.
42
+ * @param {string} [options.namespace=''] - Kubernetes namespace for the deployment.
42
43
  * @param {object} [commanderOptions] - Options passed from the command line interface.
43
44
  * @param {object} [auxRouter] - Optional router configuration for the deployment.
44
45
  * @memberof UnderpostMonitor
@@ -46,10 +47,11 @@ class UnderpostMonitor {
46
47
  async callback(
47
48
  deployId,
48
49
  env = 'development',
49
- options = { now: false, single: false, msInterval: '', type: '', replicas: '', sync: false },
50
+ options = { now: false, single: false, msInterval: '', type: '', replicas: '', sync: false, namespace: '' },
50
51
  commanderOptions,
51
52
  auxRouter,
52
53
  ) {
54
+ if (!options.namespace) options.namespace = 'default';
53
55
  if (deployId === 'dd' && fs.existsSync(`./engine-private/deploy/dd.router`)) {
54
56
  for (const _deployId of fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8').split(','))
55
57
  UnderpostMonitor.API.callback(
package/src/cli/run.js CHANGED
@@ -493,7 +493,7 @@ class UnderpostRun {
493
493
  versions = versions ? versions.replaceAll('+', ',') : defaultPath[2];
494
494
  image = image ? image : defaultPath[3];
495
495
  node = node ? node : defaultPath[4];
496
-
496
+ shellExec(`${baseCommand} cluster --ns-use ${options.namespace}`);
497
497
  if (isDeployRunnerContext(path, options)) {
498
498
  const { validVersion } = UnderpostRepository.API.privateConfUpdate(deployId);
499
499
  if (!validVersion) throw new Error('Version mismatch');
@@ -1318,6 +1318,7 @@ EOF`;
1318
1318
  if (options.command) options.command = options.command.split(',');
1319
1319
  if (options.args) options.args = options.args.split(',');
1320
1320
  if (!options.underpostRoot) options.underpostRoot = underpostRoot;
1321
+ if (!options.namespace) options.namespace = 'default';
1321
1322
  options.npmRoot = npmRoot;
1322
1323
  logger.info('callback', { path, options });
1323
1324
  if (!(runner in UnderpostRun.RUNNERS)) throw new Error(`Runner not found: ${runner}`);
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.44';
38
+ static version = 'v2.89.45';
39
39
  /**
40
40
  * Repository cli API
41
41
  * @static