i’m trying to install k3s with cilium on an alpine 3.20 virtual machine (https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-extended-3.20.0-x86_64.iso), following the steps below, but i’m getting the following error:
— error —
spec: failed to generate spec: path “/sys/fs/bpf” is mounted on “/sys” but it is not a shared mount
— install steps —
apk add dbus
dbus-uuidgen > /var/lib/dbus/machine-id
rc-update add dbus
curl -sfL https://get.k3s.io | sh -s - server --cluster-init --token ${SERVER_TOKEN}
--disable traefik
--flannel-backend=none
--disable network-policy
--disable-kube-proxy
--disable=servicelb
--tls-san=${MAIN_SERVER}
--write-kubeconfig-mode 644
--write-kubeconfig ${KUBECONFIG}
cilium install
--set=ipam.operator.clusterPoolIPv4PodCIDRList=10.42.0.0/16
--set bgpControlPlane.enabled=true
--set kubeProxyReplacement=true
--set ingressController.enabled=true
--set k8sServiceHost=${MAIN_SERVER}
--set k8sServicePort=6443
— setup bpf on alpine —
Enable CGroup2
vi /etc/rc.conf
Then edit rc_cgroup_mode, defaultly it would be #rc_cgroup_mode=”hybrid”, we should switch to unified to make sure CGroup2 in default.
rc_cgroup_mode="unified"
Then enable cgroups service:
rc-update add cgroups boot
Mount bpf
Edit /etc/init.d/sysfs:
vi /etc/init.d/sysfs
Add the following to the mount_misc section:
# Setup Kernel Support for bpf file system
if [ -d /sys/fs/bpf ] && ! mountinfo -q /sys/fs/bpf; then
if grep -qs bpf /proc/filesystems; then
ebegin "Mounting eBPF filesystem"
mount -n -t bpf -o ${sysfs_opts} bpffs /sys/fs/bpf
eend $?
fi
fi