underpost 2.8.785 → 2.8.787

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
@@ -68,7 +68,7 @@ Run dev client server
68
68
  npm run dev
69
69
  ```
70
70
  <!-- -->
71
- ## underpost ci/cd cli v2.8.785
71
+ ## underpost ci/cd cli v2.8.787
72
72
 
73
73
  ### Usage: `underpost [options] [command]`
74
74
  ```
package/bin/deploy.js CHANGED
@@ -822,6 +822,9 @@ try {
822
822
  }
823
823
 
824
824
  case 'version-deploy': {
825
+ shellExec(
826
+ `underpost secret underpost --create-from-file /home/dd/engine/engine-private/conf/dd-cron/.env.production`,
827
+ );
825
828
  shellExec(`node bin/build dd conf`);
826
829
  shellExec(`git add . && cd ./engine-private && git add .`);
827
830
  shellExec(`node bin cmt . ci package-pwa-microservices-template`);
package/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v2.8.785
1
+ ## underpost ci/cd cli v2.8.787
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -220,8 +220,8 @@ Options:
220
220
  --init-host Install k8s node necessary cli env: kind, kubeadm,
221
221
  docker, podman, helm
222
222
  --config Set k8s base node config
223
- --post-config Set k8s base node post config
224
223
  --worker Set worker node context
224
+ --chown Set k8s kube chown
225
225
  -h, --help display help for command
226
226
 
227
227
  ```
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.785'
61
+ engine.version: '2.8.787'
62
62
  networks:
63
63
  - load-balancer
64
64
 
@@ -70,8 +70,12 @@ for arg in "$@"; do
70
70
  esac
71
71
  done
72
72
 
73
+ echo "USE_KUBEADM = $USE_KUBEADM"
74
+ echo "USE_KIND = $USE_KIND"
75
+ echo "USE_WORKER = $USE_WORKER"
76
+
73
77
  underpost cluster --kubeadm
74
- underpost --reset
78
+ underpost cluster --reset
75
79
 
76
80
  # Behavior based on flags
77
81
  if $USE_KUBEADM; then
@@ -88,5 +92,5 @@ fi
88
92
 
89
93
  if $USE_WORKER; then
90
94
  echo "Running worker..."
91
- underpost cluster --worker --config --post-config
95
+ underpost cluster --worker --config
92
96
  fi
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.8.785",
5
+ "version": "2.8.787",
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",
@@ -33,8 +33,8 @@ class UnderpostCluster {
33
33
  kubeadm: false,
34
34
  initHost: false,
35
35
  config: false,
36
- postConfig: false,
37
36
  worker: false,
37
+ chown: false,
38
38
  },
39
39
  ) {
40
40
  // sudo dnf update
@@ -44,8 +44,8 @@ class UnderpostCluster {
44
44
  // 4) Install LXD with MAAS from Rocky Linux docs
45
45
  // 5) Install MAAS src from snap
46
46
  if (options.initHost === true) return UnderpostCluster.API.initHost();
47
- if (options.config) UnderpostCluster.API.config();
48
- if (options.postConfig) UnderpostCluster.API.postConfig();
47
+ if (options.config === true) UnderpostCluster.API.config();
48
+ if (options.chown === true) UnderpostCluster.API.chown();
49
49
  const npmRoot = getNpmRootPath();
50
50
  const underpostRoot = options?.dev === true ? '.' : `${npmRoot}/underpost`;
51
51
  if (options.infoCapacityPod === true) return logger.info('', UnderpostDeploy.API.resourcesFactory());
@@ -106,6 +106,7 @@ class UnderpostCluster {
106
106
  shellExec(
107
107
  `sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --control-plane-endpoint="${os.hostname()}:6443"`,
108
108
  );
109
+ UnderpostCluster.API.chown();
109
110
  // https://docs.tigera.io/calico/latest/getting-started/kubernetes/quickstart
110
111
  shellExec(
111
112
  `sudo kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.3/manifests/tigera-operator.yaml`,
@@ -123,6 +124,7 @@ class UnderpostCluster {
123
124
  if (options.full === true || options.dedicatedGpu === true) {
124
125
  // https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/
125
126
  shellExec(`cd ${underpostRoot}/manifests && kind create cluster --config kind-config-cuda.yaml`);
127
+ UnderpostCluster.API.chown();
126
128
  } else {
127
129
  shellExec(
128
130
  `cd ${underpostRoot}/manifests && kind create cluster --config kind-config${
@@ -131,7 +133,6 @@ class UnderpostCluster {
131
133
  );
132
134
  }
133
135
  }
134
- UnderpostCluster.API.postConfig({ postConfig: true });
135
136
  } else logger.warn('Cluster already initialized');
136
137
 
137
138
  // shellExec(`sudo kubectl apply -f ${underpostRoot}/manifests/kubelet-config.yaml`);
@@ -279,13 +280,7 @@ class UnderpostCluster {
279
280
  }
280
281
  },
281
282
 
282
- config(options = { postConfig: false }) {
283
- if (options.postConfig === true) {
284
- shellExec(`mkdir -p ~/.kube`);
285
- shellExec(`sudo -E cp -i /etc/kubernetes/admin.conf ~/.kube/config`);
286
- shellExec(`sudo -E chown $(id -u):$(id -g) ~/.kube/config`);
287
- return;
288
- }
283
+ config() {
289
284
  shellExec(`sudo setenforce 0`);
290
285
  shellExec(`sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config`);
291
286
  shellExec(`sudo systemctl enable --now docker`);
@@ -299,6 +294,11 @@ class UnderpostCluster {
299
294
  shellExec(`sudo systemctl restart containerd`);
300
295
  shellExec(`sysctl net.bridge.bridge-nf-call-iptables=1`);
301
296
  },
297
+ chown() {
298
+ shellExec(`mkdir -p ~/.kube`);
299
+ shellExec(`sudo -E cp -i /etc/kubernetes/admin.conf ~/.kube/config`);
300
+ shellExec(`sudo -E chown $(id -u):$(id -g) ~/.kube/config`);
301
+ },
302
302
  // This function performs a comprehensive reset of Kubernetes and container environments
303
303
  // on the host machine. Its primary goal is to clean up cluster components, temporary files,
304
304
  // and container data, ensuring a clean state for re-initialization or fresh deployments,
package/src/cli/deploy.js CHANGED
@@ -82,13 +82,13 @@ spec:
82
82
  containers:
83
83
  - name: ${deployId}-${env}-${suffix}
84
84
  image: localhost/debian-underpost:${Underpost.version}
85
- resources:
86
- requests:
87
- memory: "${resources.requests.memory}"
88
- cpu: "${resources.requests.cpu}"
89
- limits:
90
- memory: "${resources.limits.memory}"
91
- cpu: "${resources.limits.cpu}"
85
+ # resources:
86
+ # requests:
87
+ # memory: "${resources.requests.memory}"
88
+ # cpu: "${resources.requests.cpu}"
89
+ # limits:
90
+ # memory: "${resources.limits.memory}"
91
+ # cpu: "${resources.limits.cpu}"
92
92
  command:
93
93
  - /bin/sh
94
94
  - -c
package/src/cli/index.js CHANGED
@@ -113,8 +113,8 @@ program
113
113
  .option('--pull-image', 'Set optional pull associated image')
114
114
  .option('--init-host', 'Install k8s node necessary cli env: kind, kubeadm, docker, podman, helm')
115
115
  .option('--config', 'Set k8s base node config')
116
- .option('--post-config', 'Set k8s base node post config')
117
116
  .option('--worker', 'Set worker node context')
117
+ .option('--chown', 'Set k8s kube chown')
118
118
  .action(Underpost.cluster.init)
119
119
  .description('Manage cluster, for default initialization base kind cluster');
120
120
 
package/src/cli/lxd.js CHANGED
@@ -53,8 +53,13 @@ ipv6.address=none`);
53
53
  );
54
54
  }
55
55
  if (options.initVm && typeof options.initVm === 'string') {
56
- const flag = options.control === true ? '--kubeadm' : '';
57
- pbcopy(`cat ${underpostRoot}/manifests/lxd/underpost-setup.sh | lxc exec ${options.initVm} -- bash -s ${flag}`);
56
+ let flag = '';
57
+ if (options.control === true) {
58
+ flag = ' -s -- --kubeadm';
59
+ } else if (options.worker == true) {
60
+ flag = ' -s -- --worker';
61
+ }
62
+ pbcopy(`cat ${underpostRoot}/manifests/lxd/underpost-setup.sh | lxc exec ${options.initVm} -- bash${flag}`);
58
63
  }
59
64
  if (options.infoVm && typeof options.infoVm === 'string') {
60
65
  shellExec(`lxc config show ${options.infoVm}`);
package/src/index.js CHANGED
@@ -31,7 +31,7 @@ class Underpost {
31
31
  * @type {String}
32
32
  * @memberof Underpost
33
33
  */
34
- static version = 'v2.8.785';
34
+ static version = 'v2.8.787';
35
35
  /**
36
36
  * Repository cli API
37
37
  * @static