67 lines
2.0 KiB
Bash
Executable File
67 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
cd /build
|
|
|
|
echo "##################################################### Installing basic packages"
|
|
apk add alpine-base \
|
|
openrc busybox-openrc bash nftables nmap-ncat \
|
|
lm-sensors lm-sensors-fancontrol lm-sensors-fancontrol-openrc e2fsprogs u-boot-tools
|
|
|
|
# For diagnotics
|
|
apk add \
|
|
iproute2 iproute2-ss curl bind-tools procps strace tcpdump lsof jq binutils \
|
|
openssl conntrack-tools ethtool findmnt kmod coreutils util-linux zstd
|
|
echo '[ -x /bin/bash ] && exec /bin/bash -l' >> "/root/.profile"
|
|
|
|
# Compat layer for kubelet for now. Will look into building it myself later. If needed
|
|
apk add gcompat
|
|
kubelet --version || exit 1
|
|
|
|
echo "##################################################### Installing CRI-O"
|
|
mkdir -p /usr/local/bin
|
|
|
|
tar zxf crio.tar.gz
|
|
cd cri-o
|
|
|
|
./install
|
|
|
|
crio config 2>&1 > /dev/null
|
|
if [ $? -ne 0 ]; then
|
|
crio config
|
|
exit $?
|
|
fi
|
|
|
|
sed -i "s/default_runtime = \"crun\"/\0\ncgroup_manager = \"cgroupfs\"/g" /etc/crio/crio.conf.d/10-crio.conf
|
|
grep cgroup_manager /etc/crio/crio.conf.d/10-crio.conf || exit 1
|
|
|
|
echo "##################################################### Installing Control Agent"
|
|
CTL_BIN=$(find /usr/lib/monok8s/imagestore -name "ctl" | grep "$CTL_BIN_LAYER")
|
|
if [ -z "$CTL_BIN" ]; then
|
|
echo "Unable to locate the control agent binary"
|
|
exit 1
|
|
fi
|
|
ln -s "$CTL_BIN" /usr/local/bin/ctl
|
|
|
|
|
|
mkdir -p /var/run/crio
|
|
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
|
|
mkdir -p /run/crun
|
|
mkdir -p /run/runc
|
|
|
|
# Kubernetes legacy things that need to exists but have no use for us
|
|
mkdir -p /usr/libexec/kubernetes/kubelet-plugins/volume/exec
|
|
chmod 0755 /usr/libexec/kubernetes \
|
|
/usr/libexec/kubernetes/kubelet-plugins \
|
|
/usr/libexec/kubernetes/kubelet-plugins/volume \
|
|
/usr/libexec/kubernetes/kubelet-plugins/volume/exec
|
|
|
|
touch /var/log/crio/crio.log
|
|
touch /var/log/crio/kubelet.log
|