From e07969c5070f72d3714d01df4538827c1abac35a Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 15 Sep 2023 08:52:49 +0900 Subject: [PATCH] [WIP] Support Rocky Linux 9 hosts VXLAN still does not seem to work Signed-off-by: Akihiro Suda --- Makefile.d/check-preflight.sh | 2 +- README.md | 14 ++++++++++---- docker-compose.yaml | 2 ++ hack/init-host.root.sh | 14 +++++++++++++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Makefile.d/check-preflight.sh b/Makefile.d/check-preflight.sh index 3978498..6986dd6 100755 --- a/Makefile.d/check-preflight.sh +++ b/Makefile.d/check-preflight.sh @@ -59,7 +59,7 @@ else fi # Check kernel modules -for f in ip6_tables ip6table_nat ip_tables iptable_nat vxlan; do +for f in br_netfilter ip6_tables ip6table_nat ip_tables iptable_nat vxlan; do if ! grep -qw "^$f" /proc/modules; then WARNING "Kernel module \"${f}\" does not seem loaded? (negligible if built-in to the kernel)" fi diff --git a/README.md b/README.md index 8c015f9..0bd2046 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,10 @@ but Usernetes (Gen 2) supports creating a cluster with multiple hosts. ## Requirements -> **Note** -> -> Using Ubuntu 22.04 hosts is recommended. +- Host OS should be one of the following: + - Ubuntu 22.04 (recommended) + - Rocky Linux 9 + - AlmaLinux 9 - [Rootless Docker](https://rootlesscontaine.rs/getting-started/docker/): ```bash @@ -52,7 +53,12 @@ sudo systemctl daemon-reload - Kernel modules: ``` -sudo modprobe vxlan +sudo tee /etc/modules-load.d/usernetes.conf </dev/null +br_netfilter +vxlan +EOF + +sudo systemctl restart systemd-modules-load.service ``` ## Usage diff --git a/docker-compose.yaml b/docker-compose.yaml index 9e17676..98fa77c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -32,6 +32,8 @@ services: environment: KUBECONFIG: /etc/kubernetes/admin.conf U7S_HOST_IP: ${U7S_HOST_IP} + sysctls: + - net.ipv4.ip_forward=1 networks: default: ipam: diff --git a/hack/init-host.root.sh b/hack/init-host.root.sh index 20abb9c..b59296a 100755 --- a/hack/init-host.root.sh +++ b/hack/init-host.root.sh @@ -15,8 +15,20 @@ EOF systemctl daemon-reload fi +cat >/etc/modules-load.d/usernetes.conf </dev/null 2>&1; then - curl https://get.docker.com | sh + if grep -q centos /etc/os-release; then + # Works with Rocky and Alma too + dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo + dnf -y install docker-ce + else + curl https://get.docker.com | sh + fi fi systemctl disable --now docker