Skip to content

Commit 750e9d5

Browse files
feat(lgtm-datamesh): preflight iptables modules and minikube version
The profile setup hard-failed early on inotify limits and pids_limit but let the two other fresh-host blockers through to confusing mid-bootstrap failures: missing legacy iptables modules surfaced as the registry addon timing out on CNI sandbox errors (tier 1), and minikube 1.35 as the same timeout via a dead pinned image digest. Check both up front, before any cluster work, with the fix commands in the error — same shape as the existing inotify and pids_limit gates. Modules are detected via /sys/module (covers loadable and builtin). Verified: both checks pass on the campaign host and the version gate rejects v1.35.0 / accepts v1.36.0+.
1 parent 76c8e14 commit 750e9d5

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎examples/lgtm-datamesh/scripts/setup-capstone-profile.sh‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,38 @@ if ! command -v podman >/dev/null 2>&1; then
3939
exit 1
4040
fi
4141

42+
# Confirm the legacy iptables NAT kernel modules are loaded on the HOST.
43+
# Fedora is nftables-only out of the box; inside the rootless node the CNI
44+
# portmap plugin needs the legacy ip_tables/iptable_nat modules and cannot
45+
# modprobe them itself ("Operation not permitted") — without them, hostPort
46+
# pods (the registry proxy first) fail sandbox creation forever. Loaded
47+
# loadable modules and builtins both appear under /sys/module/.
48+
missing_mods=()
49+
for m in ip_tables iptable_nat ip6_tables; do
50+
[[ -d "/sys/module/${m}" ]] || missing_mods+=("$m")
51+
done
52+
if (( ${#missing_mods[@]} > 0 )); then
53+
printf 'ERROR: kernel module(s) not loaded: %s\n' "${missing_mods[*]}" >&2
54+
printf 'The CNI portmap plugin inside the rootless node needs them and cannot\n' >&2
55+
printf 'load them itself. Load now and persist across reboots:\n' >&2
56+
printf ' sudo sh -c '\''printf "ip_tables\\niptable_nat\\nip6_tables\\n" > /etc/modules-load.d/99-kubernetes-iptables.conf'\''\n' >&2
57+
printf ' sudo systemctl restart systemd-modules-load\n' >&2
58+
exit 1
59+
fi
60+
printf '==> iptables kernel modules OK (ip_tables iptable_nat ip6_tables)\n'
61+
62+
# Confirm minikube is new enough. 1.35's registry addon pins a
63+
# kube-registry-proxy image digest that no longer exists on gcr.io, so
64+
# `minikube addons enable registry` can never succeed on it.
65+
mk_version="$(minikube version --short 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo v0.0.0)"
66+
if [[ "$(printf '%s\n' "v1.36.0" "$mk_version" | sort -V | head -1)" != "v1.36.0" ]]; then
67+
printf 'ERROR: minikube %s is too old (need >= 1.36).\n' "$mk_version" >&2
68+
printf '1.35'\''s registry addon pins a dead kube-registry-proxy image digest and\n' >&2
69+
printf 'cannot come up. Install a current minikube (e.g. to ~/.local/bin).\n' >&2
70+
exit 1
71+
fi
72+
printf '==> minikube version OK (%s)\n' "$mk_version"
73+
4274
# Confirm inotify limits (§1's tweak). Capstone runs many controllers; the
4375
# Fedora default fs.inotify.max_user_instances=128 is insufficient.
4476
inotify_instances=$(sysctl -n fs.inotify.max_user_instances 2>/dev/null || echo 0)

0 commit comments

Comments
 (0)