underpost 2.8.793 → 2.8.795
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 +19 -2
- package/cli.md +2 -2
- package/docker-compose.yml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +167 -0
- package/manifests/deployment/dd-template-development/proxy.yaml +46 -0
- package/manifests/lxd/underpost-setup.sh +5 -31
- package/manifests/valkey/service.yaml +3 -9
- package/manifests/valkey/statefulset.yaml +10 -12
- package/package.json +1 -1
- package/src/cli/cluster.js +17 -12
- package/src/cli/deploy.js +21 -2
- package/src/cli/image.js +5 -5
- package/src/cli/index.js +1 -1
- package/src/index.js +1 -1
- package/src/server/logger.js +3 -3
- package/src/server/valkey.js +1 -1
package/README.md
CHANGED
package/bin/deploy.js
CHANGED
|
@@ -797,6 +797,13 @@ try {
|
|
|
797
797
|
.replaceAll(`engine.version: '${version}'`, `engine.version: '${newVersion}'`),
|
|
798
798
|
'utf8',
|
|
799
799
|
);
|
|
800
|
+
fs.writeFileSync(
|
|
801
|
+
`./manifests/deployment/dd-template-development/deployment.yaml`,
|
|
802
|
+
fs
|
|
803
|
+
.readFileSync(`./manifests/deployment/dd-template-development/deployment.yaml`, 'utf8')
|
|
804
|
+
.replaceAll(`underpost:v${version}`, `underpost:v${newVersion}`),
|
|
805
|
+
'utf8',
|
|
806
|
+
);
|
|
800
807
|
|
|
801
808
|
if (fs.existsSync(`./.github/workflows/docker-image.yml`))
|
|
802
809
|
fs.writeFileSync(
|
|
@@ -921,6 +928,16 @@ ${shellExec(`git log | grep Author: | sort -u`, { stdout: true }).split(`\n`).jo
|
|
|
921
928
|
};
|
|
922
929
|
DefaultConf.server[host][path].apiBaseProxyPath = '/';
|
|
923
930
|
DefaultConf.server[host][path].apiBaseHost = 'www.nexodev.org';
|
|
931
|
+
} else if (confName === 'template') {
|
|
932
|
+
const host = 'default.net';
|
|
933
|
+
const path = '/';
|
|
934
|
+
DefaultConf.server[host][path].valkey = {
|
|
935
|
+
port: 6379,
|
|
936
|
+
host: 'valkey-service.default.svc.cluster.local',
|
|
937
|
+
};
|
|
938
|
+
// mongodb-0.mongodb-service
|
|
939
|
+
DefaultConf.server[host][path].db.host = 'mongodb://mongodb-service:27017';
|
|
940
|
+
confName = '';
|
|
924
941
|
} else if (confName) {
|
|
925
942
|
DefaultConf.client = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.client.json`, 'utf8'));
|
|
926
943
|
DefaultConf.server = JSON.parse(fs.readFileSync(`./engine-private/conf/${confName}/conf.server.json`, 'utf8'));
|
|
@@ -2223,7 +2240,7 @@ EOF`);
|
|
|
2223
2240
|
const args = [
|
|
2224
2241
|
`node bin dockerfile-image-build --path ${path}/backend/`,
|
|
2225
2242
|
`--image-name=${imageName} --image-path=${path}`,
|
|
2226
|
-
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'}-load --
|
|
2243
|
+
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'}-load --reset`,
|
|
2227
2244
|
];
|
|
2228
2245
|
shellExec(args.join(' '));
|
|
2229
2246
|
}
|
|
@@ -2235,7 +2252,7 @@ EOF`);
|
|
|
2235
2252
|
const args = [
|
|
2236
2253
|
`node bin dockerfile-image-build --path ${path}/frontend/`,
|
|
2237
2254
|
`--image-name=${imageName} --image-path=${path}`,
|
|
2238
|
-
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'}-load --
|
|
2255
|
+
`--podman-save --${process.argv.includes('kubeadm') ? 'kubeadm' : 'kind'}-load --reset`,
|
|
2239
2256
|
];
|
|
2240
2257
|
shellExec(args.join(' '));
|
|
2241
2258
|
}
|
package/cli.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## underpost ci/cd cli v2.8.
|
|
1
|
+
## underpost ci/cd cli v2.8.795
|
|
2
2
|
|
|
3
3
|
### Usage: `underpost [options] [command]`
|
|
4
4
|
```
|
|
@@ -298,7 +298,7 @@ Options:
|
|
|
298
298
|
--kubeadm-load Import tar image to Kubeadm cluster
|
|
299
299
|
--secrets Dockerfile env secrets
|
|
300
300
|
--secrets-path [secrets-path] Dockerfile custom path env secrets
|
|
301
|
-
--
|
|
301
|
+
--reset Build without using cache
|
|
302
302
|
-h, --help display help for command
|
|
303
303
|
|
|
304
304
|
```
|
package/docker-compose.yml
CHANGED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
name: dd-template-development-blue
|
|
6
|
+
labels:
|
|
7
|
+
app: dd-template-development-blue
|
|
8
|
+
spec:
|
|
9
|
+
replicas: 1
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels:
|
|
12
|
+
app: dd-template-development-blue
|
|
13
|
+
template:
|
|
14
|
+
metadata:
|
|
15
|
+
labels:
|
|
16
|
+
app: dd-template-development-blue
|
|
17
|
+
spec:
|
|
18
|
+
containers:
|
|
19
|
+
- name: dd-template-development-blue
|
|
20
|
+
image: localhost/debian-underpost:v2.8.795
|
|
21
|
+
# resources:
|
|
22
|
+
# requests:
|
|
23
|
+
# memory: "124Ki"
|
|
24
|
+
# cpu: "100m"
|
|
25
|
+
# limits:
|
|
26
|
+
# memory: "1992Ki"
|
|
27
|
+
# cpu: "1600m"
|
|
28
|
+
command:
|
|
29
|
+
- /bin/sh
|
|
30
|
+
- -c
|
|
31
|
+
- >
|
|
32
|
+
npm install -g npm@11.2.0 &&
|
|
33
|
+
npm install -g underpost &&
|
|
34
|
+
cd $(underpost root)/underpost &&
|
|
35
|
+
node bin/deploy update-default-conf template &&
|
|
36
|
+
mkdir -p /home/dd &&
|
|
37
|
+
cd /home/dd &&
|
|
38
|
+
underpost new engine
|
|
39
|
+
---
|
|
40
|
+
apiVersion: v1
|
|
41
|
+
kind: Service
|
|
42
|
+
metadata:
|
|
43
|
+
name: dd-template-development-blue-service
|
|
44
|
+
spec:
|
|
45
|
+
selector:
|
|
46
|
+
app: dd-template-development-blue
|
|
47
|
+
ports:
|
|
48
|
+
- name: "tcp-4001"
|
|
49
|
+
protocol: TCP
|
|
50
|
+
port: 4001
|
|
51
|
+
targetPort: 4001
|
|
52
|
+
- name: "udp-4001"
|
|
53
|
+
protocol: UDP
|
|
54
|
+
port: 4001
|
|
55
|
+
targetPort: 4001
|
|
56
|
+
|
|
57
|
+
- name: "tcp-4002"
|
|
58
|
+
protocol: TCP
|
|
59
|
+
port: 4002
|
|
60
|
+
targetPort: 4002
|
|
61
|
+
- name: "udp-4002"
|
|
62
|
+
protocol: UDP
|
|
63
|
+
port: 4002
|
|
64
|
+
targetPort: 4002
|
|
65
|
+
|
|
66
|
+
- name: "tcp-4003"
|
|
67
|
+
protocol: TCP
|
|
68
|
+
port: 4003
|
|
69
|
+
targetPort: 4003
|
|
70
|
+
- name: "udp-4003"
|
|
71
|
+
protocol: UDP
|
|
72
|
+
port: 4003
|
|
73
|
+
targetPort: 4003
|
|
74
|
+
|
|
75
|
+
- name: "tcp-4004"
|
|
76
|
+
protocol: TCP
|
|
77
|
+
port: 4004
|
|
78
|
+
targetPort: 4004
|
|
79
|
+
- name: "udp-4004"
|
|
80
|
+
protocol: UDP
|
|
81
|
+
port: 4004
|
|
82
|
+
targetPort: 4004
|
|
83
|
+
type: LoadBalancer
|
|
84
|
+
---
|
|
85
|
+
apiVersion: apps/v1
|
|
86
|
+
kind: Deployment
|
|
87
|
+
metadata:
|
|
88
|
+
name: dd-template-development-green
|
|
89
|
+
labels:
|
|
90
|
+
app: dd-template-development-green
|
|
91
|
+
spec:
|
|
92
|
+
replicas: 1
|
|
93
|
+
selector:
|
|
94
|
+
matchLabels:
|
|
95
|
+
app: dd-template-development-green
|
|
96
|
+
template:
|
|
97
|
+
metadata:
|
|
98
|
+
labels:
|
|
99
|
+
app: dd-template-development-green
|
|
100
|
+
spec:
|
|
101
|
+
containers:
|
|
102
|
+
- name: dd-template-development-green
|
|
103
|
+
image: localhost/debian-underpost:v2.8.795
|
|
104
|
+
# resources:
|
|
105
|
+
# requests:
|
|
106
|
+
# memory: "124Ki"
|
|
107
|
+
# cpu: "100m"
|
|
108
|
+
# limits:
|
|
109
|
+
# memory: "1992Ki"
|
|
110
|
+
# cpu: "1600m"
|
|
111
|
+
command:
|
|
112
|
+
- /bin/sh
|
|
113
|
+
- -c
|
|
114
|
+
- >
|
|
115
|
+
npm install -g npm@11.2.0 &&
|
|
116
|
+
npm install -g underpost &&
|
|
117
|
+
cd $(underpost root)/underpost &&
|
|
118
|
+
node bin/deploy update-default-conf template &&
|
|
119
|
+
mkdir -p /home/dd &&
|
|
120
|
+
cd /home/dd &&
|
|
121
|
+
underpost new engine
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
apiVersion: v1
|
|
125
|
+
kind: Service
|
|
126
|
+
metadata:
|
|
127
|
+
name: dd-template-development-green-service
|
|
128
|
+
spec:
|
|
129
|
+
selector:
|
|
130
|
+
app: dd-template-development-green
|
|
131
|
+
ports:
|
|
132
|
+
- name: "tcp-4001"
|
|
133
|
+
protocol: TCP
|
|
134
|
+
port: 4001
|
|
135
|
+
targetPort: 4001
|
|
136
|
+
- name: "udp-4001"
|
|
137
|
+
protocol: UDP
|
|
138
|
+
port: 4001
|
|
139
|
+
targetPort: 4001
|
|
140
|
+
|
|
141
|
+
- name: "tcp-4002"
|
|
142
|
+
protocol: TCP
|
|
143
|
+
port: 4002
|
|
144
|
+
targetPort: 4002
|
|
145
|
+
- name: "udp-4002"
|
|
146
|
+
protocol: UDP
|
|
147
|
+
port: 4002
|
|
148
|
+
targetPort: 4002
|
|
149
|
+
|
|
150
|
+
- name: "tcp-4003"
|
|
151
|
+
protocol: TCP
|
|
152
|
+
port: 4003
|
|
153
|
+
targetPort: 4003
|
|
154
|
+
- name: "udp-4003"
|
|
155
|
+
protocol: UDP
|
|
156
|
+
port: 4003
|
|
157
|
+
targetPort: 4003
|
|
158
|
+
|
|
159
|
+
- name: "tcp-4004"
|
|
160
|
+
protocol: TCP
|
|
161
|
+
port: 4004
|
|
162
|
+
targetPort: 4004
|
|
163
|
+
- name: "udp-4004"
|
|
164
|
+
protocol: UDP
|
|
165
|
+
port: 4004
|
|
166
|
+
targetPort: 4004
|
|
167
|
+
type: LoadBalancer
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# "http://default.net:4001/socket.io": "http://localhost:4001/socket.io",
|
|
2
|
+
# "http://default.net:4002/peer": "http://localhost:4002/peer",
|
|
3
|
+
# "http://default.net:4001/": "http://localhost:4001/",
|
|
4
|
+
# "http://www.default.net:4003/": "http://localhost:4003/"
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
apiVersion: projectcontour.io/v1
|
|
8
|
+
kind: HTTPProxy
|
|
9
|
+
metadata:
|
|
10
|
+
name: default.net
|
|
11
|
+
spec:
|
|
12
|
+
virtualhost:
|
|
13
|
+
fqdn: default.net
|
|
14
|
+
routes:
|
|
15
|
+
- conditions:
|
|
16
|
+
- prefix: /
|
|
17
|
+
enableWebsockets: true
|
|
18
|
+
services:
|
|
19
|
+
- name: dd-template-development-blue-service
|
|
20
|
+
port: 4001
|
|
21
|
+
weight: 100
|
|
22
|
+
|
|
23
|
+
- conditions:
|
|
24
|
+
- prefix: /peer
|
|
25
|
+
enableWebsockets: true
|
|
26
|
+
services:
|
|
27
|
+
- name: dd-template-development-blue-service
|
|
28
|
+
port: 4002
|
|
29
|
+
weight: 100
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
apiVersion: projectcontour.io/v1
|
|
33
|
+
kind: HTTPProxy
|
|
34
|
+
metadata:
|
|
35
|
+
name: www.default.net
|
|
36
|
+
spec:
|
|
37
|
+
virtualhost:
|
|
38
|
+
fqdn: www.default.net
|
|
39
|
+
routes:
|
|
40
|
+
- conditions:
|
|
41
|
+
- prefix: /
|
|
42
|
+
enableWebsockets: true
|
|
43
|
+
services:
|
|
44
|
+
- name: dd-template-development-blue-service
|
|
45
|
+
port: 4003
|
|
46
|
+
weight: 100
|
|
@@ -53,7 +53,7 @@ echo "
|
|
|
53
53
|
██╗░░░██╗███╗░░██╗██████╗░███████╗██████╗░██████╗░░█████╗░░██████╗████████╗
|
|
54
54
|
██║░░░██║████╗░██║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
|
|
55
55
|
██║░░░██║██╔██╗██║██║░░██║█████╗░░██████╔╝██████╔╝██║░░██║╚█████╗░░░░██║░░░
|
|
56
|
-
|
|
56
|
+
██║░░░██║██║╚████║██║░░██║██╔══╝░░██╔══██╗██╔═══╝░██║░░██║░╚═══██╗░░░██║░░░
|
|
57
57
|
╚██████╔╝██║░╚███║██████╔╝███████╗██║░░██║██║░░░░░╚█████╔╝██████╔╝░░░██║░░░
|
|
58
58
|
░╚═════╝░╚═╝░░╚══╝╚═════╝░╚══════╝╚═╝░░╚═╝╚═╝░░░░░░╚════╝░╚═════╝░░░░╚═╝░░░
|
|
59
59
|
|
|
@@ -74,29 +74,6 @@ npm install -g underpost
|
|
|
74
74
|
echo "Loading br_netfilter kernel module..."
|
|
75
75
|
sudo modprobe br_netfilter
|
|
76
76
|
|
|
77
|
-
# --- Disable UFW (Crucial for Kubernetes) ---
|
|
78
|
-
# UFW conflicts with Kubernetes' iptables management. Disable it completely.
|
|
79
|
-
echo "Disabling UFW to prevent conflicts with Kubernetes..."
|
|
80
|
-
if sudo systemctl is-active --quiet ufw; then
|
|
81
|
-
sudo systemctl stop ufw
|
|
82
|
-
fi
|
|
83
|
-
if sudo systemctl is-enabled --quiet ufw; then
|
|
84
|
-
sudo systemctl disable ufw
|
|
85
|
-
fi
|
|
86
|
-
# Attempt to remove ufw package. dnf will handle if it's not installed.
|
|
87
|
-
echo "Attempting to remove ufw package..."
|
|
88
|
-
sudo dnf remove -y ufw
|
|
89
|
-
|
|
90
|
-
# --- Kubernetes Required Ports (Informational - not for UFW) ---
|
|
91
|
-
# These ports are opened by Kubernetes itself or are expected to be open
|
|
92
|
-
# by external firewalls. UFW is no longer managing them.
|
|
93
|
-
echo "Note: Kubernetes requires the following ports to be open (managed by K8s or external firewall):"
|
|
94
|
-
echo " - Control Plane: 6443/TCP (Kubernetes API), 2379-2380/TCP (etcd)"
|
|
95
|
-
echo " - Worker Nodes: 10250/TCP (Kubelet API), 30000-32767/TCP/UDP (NodePorts)"
|
|
96
|
-
echo " - CNI specific ports (e.g., Calico: 179/TCP, 4789/UDP; Flannel: 8472/UDP)"
|
|
97
|
-
echo " - SSH: 22/TCP"
|
|
98
|
-
echo " - HTTP/HTTPS: 80/TCP, 443/TCP (for Ingress/Load Balancers)"
|
|
99
|
-
|
|
100
77
|
# --- Initial Host Setup for Kubernetes Prerequisites ---
|
|
101
78
|
# This calls the initHost method in cluster.js to install Docker, Podman, Kind, Kubeadm, Helm.
|
|
102
79
|
echo "Running initial host setup for Kubernetes prerequisites..."
|
|
@@ -130,9 +107,8 @@ echo "USE_WORKER = $USE_WORKER"
|
|
|
130
107
|
|
|
131
108
|
# --- Kubernetes Cluster Initialization Logic ---
|
|
132
109
|
|
|
133
|
-
#
|
|
134
|
-
|
|
135
|
-
echo "Applying Kubernetes host configuration (SELinux, Containerd, Sysctl)..."
|
|
110
|
+
# Apply host configuration (SELinux, Containerd, Sysctl, and now firewalld disabling)
|
|
111
|
+
echo "Applying Kubernetes host configuration (SELinux, Containerd, Sysctl, Firewalld)..."
|
|
136
112
|
underpost cluster --config
|
|
137
113
|
|
|
138
114
|
if $USE_KUBEADM; then
|
|
@@ -144,21 +120,19 @@ if $USE_KUBEADM; then
|
|
|
144
120
|
# For a full automated setup, you'd typically pass the join token/command here.
|
|
145
121
|
# Example: underpost cluster --worker --join-command "kubeadm join ..."
|
|
146
122
|
# For now, this just runs the worker-specific config.
|
|
147
|
-
underpost cluster --worker
|
|
123
|
+
underpost cluster --worker
|
|
124
|
+
underpost cluster --chown
|
|
148
125
|
echo "Worker node setup initiated. You will need to manually join this worker to your control plane."
|
|
149
126
|
echo "On your control plane, run 'kubeadm token create --print-join-command' and execute the output here."
|
|
150
127
|
else
|
|
151
128
|
echo "Running control plane setup with kubeadm..."
|
|
152
129
|
# This will initialize the kubeadm control plane and install Calico
|
|
153
130
|
underpost cluster --kubeadm
|
|
154
|
-
# Ensure kubectl config is set up for the current user
|
|
155
|
-
underpost cluster --chown
|
|
156
131
|
echo "Kubeadm control plane initialized. Check cluster status with 'kubectl get nodes'."
|
|
157
132
|
fi
|
|
158
133
|
elif $USE_KIND; then
|
|
159
134
|
echo "Running control node with kind..."
|
|
160
135
|
underpost cluster
|
|
161
|
-
underpost cluster --chown
|
|
162
136
|
echo "Kind cluster initialized. Check cluster status with 'kubectl get nodes'."
|
|
163
137
|
else
|
|
164
138
|
echo "No specific cluster role (--kubeadm, --kind, --worker) specified. Please provide one."
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
---
|
|
2
1
|
apiVersion: v1
|
|
3
2
|
kind: Service
|
|
4
3
|
metadata:
|
|
5
|
-
name: service
|
|
4
|
+
name: valkey-service
|
|
6
5
|
namespace: default
|
|
7
6
|
spec:
|
|
7
|
+
selector:
|
|
8
|
+
app: valkey-service
|
|
8
9
|
ports:
|
|
9
10
|
- port: 6379
|
|
10
11
|
targetPort: 6379
|
|
11
|
-
selector:
|
|
12
|
-
app: service-valkey
|
|
13
|
-
ipFamilyPolicy: PreferDualStack
|
|
14
|
-
ipFamilies:
|
|
15
|
-
- IPv4
|
|
16
|
-
# - IPv6
|
|
17
|
-
type: ClusterIP
|
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
apiVersion: apps/v1
|
|
2
2
|
kind: StatefulSet
|
|
3
3
|
metadata:
|
|
4
|
-
name: service
|
|
4
|
+
name: valkey-service
|
|
5
5
|
namespace: default
|
|
6
6
|
spec:
|
|
7
|
-
serviceName: service
|
|
7
|
+
serviceName: valkey-service
|
|
8
8
|
replicas: 1
|
|
9
9
|
selector:
|
|
10
10
|
matchLabels:
|
|
11
|
-
app: service
|
|
11
|
+
app: valkey-service
|
|
12
12
|
template:
|
|
13
13
|
metadata:
|
|
14
14
|
labels:
|
|
15
|
-
app: service
|
|
15
|
+
app: valkey-service
|
|
16
16
|
spec:
|
|
17
|
-
# Prevent automatic token mounting if you're not using the default ServiceAccount
|
|
18
17
|
automountServiceAccountToken: false
|
|
19
|
-
|
|
20
18
|
containers:
|
|
21
|
-
- name: service
|
|
19
|
+
- name: valkey-service
|
|
22
20
|
image: docker.io/valkey/valkey:latest
|
|
23
21
|
imagePullPolicy: IfNotPresent
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
value: Europe/Zurich
|
|
22
|
+
command: ["valkey-server"]
|
|
23
|
+
args: ["--port", "6379"]
|
|
27
24
|
ports:
|
|
28
25
|
- containerPort: 6379
|
|
29
26
|
startupProbe:
|
|
30
27
|
tcpSocket:
|
|
31
28
|
port: 6379
|
|
32
|
-
failureThreshold: 30
|
|
33
29
|
periodSeconds: 5
|
|
34
30
|
timeoutSeconds: 5
|
|
31
|
+
failureThreshold: 30
|
|
35
32
|
livenessProbe:
|
|
36
33
|
tcpSocket:
|
|
37
34
|
port: 6379
|
|
38
|
-
|
|
35
|
+
initialDelaySeconds: 10
|
|
39
36
|
periodSeconds: 30
|
|
40
37
|
timeoutSeconds: 5
|
|
38
|
+
failureThreshold: 2
|
package/package.json
CHANGED
package/src/cli/cluster.js
CHANGED
|
@@ -41,10 +41,10 @@ class UnderpostCluster {
|
|
|
41
41
|
if (options.initHost === true) return UnderpostCluster.API.initHost();
|
|
42
42
|
|
|
43
43
|
// Applies general host configuration (SELinux, containerd, sysctl)
|
|
44
|
-
if (options.config === true) UnderpostCluster.API.config();
|
|
44
|
+
if (options.config === true) return UnderpostCluster.API.config();
|
|
45
45
|
|
|
46
46
|
// Sets up kubectl configuration for the current user
|
|
47
|
-
if (options.chown === true) UnderpostCluster.API.chown();
|
|
47
|
+
if (options.chown === true) return UnderpostCluster.API.chown();
|
|
48
48
|
|
|
49
49
|
const npmRoot = getNpmRootPath();
|
|
50
50
|
const underpostRoot = options?.dev === true ? '.' : `${npmRoot}/underpost`;
|
|
@@ -132,7 +132,6 @@ class UnderpostCluster {
|
|
|
132
132
|
logger.info('Initializing Kind cluster...');
|
|
133
133
|
if (options.full === true || options.dedicatedGpu === true) {
|
|
134
134
|
shellExec(`cd ${underpostRoot}/manifests && kind create cluster --config kind-config-cuda.yaml`);
|
|
135
|
-
UnderpostCluster.API.chown();
|
|
136
135
|
} else {
|
|
137
136
|
shellExec(
|
|
138
137
|
`cd ${underpostRoot}/manifests && kind create cluster --config kind-config${
|
|
@@ -140,6 +139,7 @@ class UnderpostCluster {
|
|
|
140
139
|
}.yaml`,
|
|
141
140
|
);
|
|
142
141
|
}
|
|
142
|
+
UnderpostCluster.API.chown();
|
|
143
143
|
}
|
|
144
144
|
} else if (options.worker === true) {
|
|
145
145
|
// Worker node specific configuration (kubeadm join command needs to be executed separately)
|
|
@@ -172,7 +172,7 @@ class UnderpostCluster {
|
|
|
172
172
|
} valkey/valkey:latest`,
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
shellExec(`kubectl delete statefulset service
|
|
175
|
+
shellExec(`kubectl delete statefulset valkey-service`);
|
|
176
176
|
shellExec(`kubectl apply -k ${underpostRoot}/manifests/valkey`);
|
|
177
177
|
}
|
|
178
178
|
if (options.full === true || options.mariadb === true) {
|
|
@@ -327,15 +327,20 @@ class UnderpostCluster {
|
|
|
327
327
|
|
|
328
328
|
// Enable bridge-nf-call-iptables for Kubernetes networking
|
|
329
329
|
// This ensures traffic through Linux bridges is processed by iptables (crucial for CNI)
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
for (const iptableConfPath of [
|
|
331
|
+
`/etc/sysctl.d/k8s.conf`,
|
|
332
|
+
`/etc/sysctl.d/99-k8s-ipforward.conf`,
|
|
333
|
+
`/etc/sysctl.d/99-k8s.conf`,
|
|
334
|
+
])
|
|
335
|
+
shellExec(`echo 'net.bridge.bridge-nf-call-iptables = 1
|
|
336
|
+
net.bridge.bridge-nf-call-ip6tables = 1
|
|
337
|
+
net.bridge.bridge-nf-call-arptables = 1
|
|
338
|
+
net.ipv4.ip_forward = 1' | sudo tee ${iptableConfPath}`);
|
|
334
339
|
shellExec(`sudo sysctl --system`); // Apply sysctl changes immediately
|
|
335
340
|
|
|
336
|
-
//
|
|
337
|
-
|
|
338
|
-
|
|
341
|
+
// Disable firewalld (common cause of network issues in Kubernetes)
|
|
342
|
+
shellExec(`sudo systemctl stop firewalld || true`); // Stop if running
|
|
343
|
+
shellExec(`sudo systemctl disable firewalld || true`); // Disable from starting on boot
|
|
339
344
|
},
|
|
340
345
|
|
|
341
346
|
/**
|
|
@@ -391,7 +396,7 @@ class UnderpostCluster {
|
|
|
391
396
|
// Re-configure Docker's default storage location (if desired).
|
|
392
397
|
shellExec('sudo mv /var/lib/docker /var/lib/docker~ || true'); // Use || true to prevent error if dir doesn't exist
|
|
393
398
|
shellExec('sudo mkdir -p /home/docker');
|
|
394
|
-
shellExec('sudo chmod
|
|
399
|
+
shellExec('sudo chmod 777 /home/docker');
|
|
395
400
|
shellExec('sudo ln -s /home/docker /var/lib/docker');
|
|
396
401
|
|
|
397
402
|
// Prune all unused Podman data.
|
package/src/cli/deploy.js
CHANGED
|
@@ -256,8 +256,8 @@ kubectl rollout restart deployment/deployment-name
|
|
|
256
256
|
kubectl rollout undo deployment/deployment-name
|
|
257
257
|
kubectl scale statefulsets <stateful-set-name> --replicas=<new-replicas>
|
|
258
258
|
kubectl get pods -w
|
|
259
|
-
kubectl patch statefulset service
|
|
260
|
-
kubectl patch statefulset service
|
|
259
|
+
kubectl patch statefulset valkey-service --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"valkey/valkey:latest"}]'
|
|
260
|
+
kubectl patch statefulset valkey-service -p '{"spec":{"template":{"spec":{"containers":[{"name":"valkey-service","imagePullPolicy":"Never"}]}}}}'
|
|
261
261
|
kubectl logs -f <pod-name>
|
|
262
262
|
kubectl describe pod <pod-name>
|
|
263
263
|
kubectl exec -it <pod-name> -- bash
|
|
@@ -273,6 +273,25 @@ kubectl patch ippool default-ipv4-ippool --type='json' -p='[{"op": "replace", "p
|
|
|
273
273
|
kubectl patch ippool default-ipv4-ippool --type='json' -p='[{"op": "replace", "path": "/spec/cidr", "value": "192.168.0.0/24"}]'
|
|
274
274
|
sudo podman run --rm localhost/<image-name>:<image-version> <command>
|
|
275
275
|
kubectl get configmap kubelet-config -n kube-system -o yaml > kubelet-config.yaml
|
|
276
|
+
kubectl -n kube-system rollout restart daemonset kube-proxy
|
|
277
|
+
|
|
278
|
+
kubectl get EndpointSlice -o wide --all-namespaces -w
|
|
279
|
+
|
|
280
|
+
kubectl run --rm -it test-dns --image=busybox:latest --restart=Never -- /bin/sh -c "
|
|
281
|
+
nslookup kubernetes.default.svc.cluster.local;
|
|
282
|
+
nslookup mongodb-service.default.svc.cluster.local;
|
|
283
|
+
nslookup valkey-service.default.svc.cluster.local;
|
|
284
|
+
nc -vz mongodb-service 27017;
|
|
285
|
+
nc -vz valkey-service 6379;
|
|
286
|
+
echo exit code: \\\$?
|
|
287
|
+
"
|
|
288
|
+
|
|
289
|
+
kubectl apply -f - <<EOF
|
|
290
|
+
apiVersion: apps/v1
|
|
291
|
+
kind: StatefulSet
|
|
292
|
+
metadata:
|
|
293
|
+
name: ...
|
|
294
|
+
EOF
|
|
276
295
|
`);
|
|
277
296
|
if (deployList === 'dd' && fs.existsSync(`./engine-private/deploy/dd.router`))
|
|
278
297
|
deployList = fs.readFileSync(`./engine-private/deploy/dd.router`, 'utf8');
|
package/src/cli/image.js
CHANGED
|
@@ -23,9 +23,9 @@ class UnderpostImage {
|
|
|
23
23
|
shellExec(`sudo podman pull docker.io/library/debian:buster`);
|
|
24
24
|
const IMAGE_NAME = `debian-underpost`;
|
|
25
25
|
const IMAGE_NAME_FULL = `${IMAGE_NAME}:${options.version ?? Underpost.version}`;
|
|
26
|
-
const LOAD_TYPE = options.kindLoad === true ? `--
|
|
26
|
+
const LOAD_TYPE = options.kindLoad === true ? `--kind-load` : `--kubeadm-load`;
|
|
27
27
|
shellExec(
|
|
28
|
-
`underpost dockerfile-image-build --podman-save --
|
|
28
|
+
`underpost dockerfile-image-build --podman-save --reset --image-path=. --path ${
|
|
29
29
|
options.path ?? getUnderpostRootPath()
|
|
30
30
|
} --image-name=${IMAGE_NAME_FULL} ${LOAD_TYPE}`,
|
|
31
31
|
);
|
|
@@ -41,7 +41,7 @@ class UnderpostImage {
|
|
|
41
41
|
kubeadmLoad: false,
|
|
42
42
|
secrets: false,
|
|
43
43
|
secretsPath: '',
|
|
44
|
-
|
|
44
|
+
reset: false,
|
|
45
45
|
},
|
|
46
46
|
) {
|
|
47
47
|
const {
|
|
@@ -53,7 +53,7 @@ class UnderpostImage {
|
|
|
53
53
|
secrets,
|
|
54
54
|
secretsPath,
|
|
55
55
|
kindLoad,
|
|
56
|
-
|
|
56
|
+
reset,
|
|
57
57
|
kubeadmLoad,
|
|
58
58
|
} = options;
|
|
59
59
|
const podManImg = `localhost/${imageName}`;
|
|
@@ -75,7 +75,7 @@ class UnderpostImage {
|
|
|
75
75
|
secretDockerInput += ` --secret id=${key},env=${key} \ `;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
78
|
+
if (reset === true) cache += ' --rm --no-cache';
|
|
79
79
|
if (path && typeof path === 'string')
|
|
80
80
|
shellExec(
|
|
81
81
|
`cd ${path}${secretsInput}&& sudo podman build -f ./${
|
package/src/cli/index.js
CHANGED
|
@@ -170,7 +170,7 @@ program
|
|
|
170
170
|
.option('--kubeadm-load', 'Import tar image to Kubeadm cluster')
|
|
171
171
|
.option('--secrets', 'Dockerfile env secrets')
|
|
172
172
|
.option('--secrets-path [secrets-path]', 'Dockerfile custom path env secrets')
|
|
173
|
-
.option('--
|
|
173
|
+
.option('--reset', 'Build without using cache')
|
|
174
174
|
.description('Build image from Dockerfile')
|
|
175
175
|
.action(Underpost.image.dockerfile.build);
|
|
176
176
|
|
package/src/index.js
CHANGED
package/src/server/logger.js
CHANGED
|
@@ -176,7 +176,7 @@ const loggerMiddleware = (meta = { url: '' }) => {
|
|
|
176
176
|
);
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
const
|
|
179
|
+
const underpostASCII = () => `
|
|
180
180
|
|
|
181
181
|
██╗░░░██╗███╗░░██╗██████╗░███████╗██████╗░██████╗░░█████╗░░██████╗████████╗
|
|
182
182
|
██║░░░██║████╗░██║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
|
|
@@ -188,10 +188,10 @@ const underpostASCI = () => `
|
|
|
188
188
|
|
|
189
189
|
const actionInitLog = () =>
|
|
190
190
|
console.log(
|
|
191
|
-
|
|
191
|
+
underpostASCII() +
|
|
192
192
|
`
|
|
193
193
|
https://www.nexodev.org/docs
|
|
194
194
|
`,
|
|
195
195
|
);
|
|
196
196
|
|
|
197
|
-
export { loggerFactory, loggerMiddleware, setUpInfo,
|
|
197
|
+
export { loggerFactory, loggerMiddleware, setUpInfo, underpostASCII, actionInitLog };
|
package/src/server/valkey.js
CHANGED
|
@@ -34,7 +34,7 @@ const selectDtoFactory = (payload, select) => {
|
|
|
34
34
|
const valkeyClientFactory = async (options) => {
|
|
35
35
|
const valkey = new Valkey({
|
|
36
36
|
// port: 6379,
|
|
37
|
-
// host: 'service
|
|
37
|
+
// host: 'valkey-service.default.svc.cluster.local',
|
|
38
38
|
port: options?.port ? options.port : undefined,
|
|
39
39
|
host: options?.port ? options.host : undefined,
|
|
40
40
|
retryStrategy: (attempt) => {
|