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 +1 -1
- package/bin/deploy.js +3 -0
- package/cli.md +2 -2
- package/docker-compose.yml +1 -1
- package/manifests/lxd/underpost-setup.sh +6 -2
- package/package.json +1 -1
- package/src/cli/cluster.js +11 -11
- package/src/cli/deploy.js +7 -7
- package/src/cli/index.js +1 -1
- package/src/cli/lxd.js +7 -2
- package/src/index.js +1 -1
package/README.md
CHANGED
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.
|
|
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
|
```
|
package/docker-compose.yml
CHANGED
|
@@ -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
|
|
95
|
+
underpost cluster --worker --config
|
|
92
96
|
fi
|
package/package.json
CHANGED
package/src/cli/cluster.js
CHANGED
|
@@ -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.
|
|
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(
|
|
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
|
-
|
|
57
|
-
|
|
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}`);
|