commit 25e17a14a4d64a9781930b098fae1ad152314b4b2e298d32c31e91563e18667c
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-03-26T07:06:33Z |
| subject | services for bootstrapping |
commit 25e17a14a4d64a9781930b098fae1ad152314b4b2e298d32c31e91563e18667c
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-03-26T07:06:33Z
services for bootstrapping
---
alpine/configure-system.sh | 2 ++
alpine/install-packages.sh | 1 +
alpine/rootfs-extra/etc/init.d/apply-node-config | 16 ++++++++++++++++
alpine/rootfs-extra/etc/init.d/bootstrap-cluster | 17 +++++++++++++++++
docs/uboot.md | 1 +
5 files changed, 37 insertions(+)
diff --git a/alpine/configure-system.sh b/alpine/configure-system.sh
index 9d931d1..a4d49a5 100755
--- a/alpine/configure-system.sh
+++ b/alpine/configure-system.sh
@@ -11,3 +11,5 @@ rc-update add fancontrol boot
rc-update add loopback boot
rc-update add hostname boot
rc-update add localmount boot
+rc-update add apply-node-config default
+rc-update add bootstrap-cluster default
diff --git a/alpine/install-packages.sh b/alpine/install-packages.sh
index c5a834e..5fe0d75 100755
--- a/alpine/install-packages.sh
+++ b/alpine/install-packages.sh
@@ -39,6 +39,7 @@ mkdir -p /var/lib/containers/storage
mkdir -p /var/lib/cni
mkdir -p /var/log/crio
mkdir -p /var/log/kubelet
+mkdir -p /var/log/monok8s
mkdir -p /etc/cni/net.d
mkdir -p /opt/cni/bin
mkdir -p /etc/kubernetes/manifests
diff --git a/alpine/rootfs-extra/etc/init.d/apply-node-config b/alpine/rootfs-extra/etc/init.d/apply-node-config
new file mode 100755
index 0000000..546b958
--- /dev/null
+++ b/alpine/rootfs-extra/etc/init.d/apply-node-config
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+
+export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
+
+name="Apply node config"
+description="Apply node configurations using node.env from /opt/monok8s/config"
+
+command="/opt/monok8s/scripts/apply-node-config.sh"
+command_background="no"
+
+output_log="/var/log/monok8s/apply-node-config.log"
+error_log="/var/log/monok8s/apply-node-config.err"
+
+depend() {
+ need localmount
+}
diff --git a/alpine/rootfs-extra/etc/init.d/bootstrap-cluster b/alpine/rootfs-extra/etc/init.d/bootstrap-cluster
new file mode 100755
index 0000000..d9893db
--- /dev/null
+++ b/alpine/rootfs-extra/etc/init.d/bootstrap-cluster
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+
+export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
+
+name="Bootstrap cluster"
+description="Apply node configurations using node.env from /opt/monok8s/config"
+
+command="/opt/monok8s/scripts/bootstrap-cluster.sh"
+command_background="no"
+
+output_log="/var/log/monok8s/bootstrap.log"
+error_log="/var/log/monok8s/bootstrap.err"
+
+depend() {
+ need apply-node-config
+ use net
+}
diff --git a/docs/uboot.md b/docs/uboot.md
index cdfcf4d..7b29601 100644
--- a/docs/uboot.md
+++ b/docs/uboot.md
@@ -4,6 +4,7 @@ Booting release image with bootusb
setenv bootusb '
usb start;
setenv kernel_addr_r 0xa0000000;
+setenv bootargs "console=ttyS0,115200 root=/dev/sda2 data=/dev/sda4 rw rootwait;"
ext4load usb 0:2 ${kernel_addr_r} /boot/kernel.itb;
bootm ${kernel_addr_r};
'