Skip to content

fix(cluster): load br_netfilter in the Colima VM now and at every boot - #170

Merged
Mearman merged 1 commit into
mainfrom
fix/br-netfilter-colima-vm
Nov 2, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/br-netfilter-colima-vm

Conversation

@Mearman

@Mearman Mearman commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

On a Colima host the node runs in a Linux VM that does not load br_netfilter. With host-network k3s (flannel cni0 bridge), a pod that talks to a Service whose single backend pod is on the same node gets no reply, since bridged hairpin traffic skips the reverse NAT without bridge-nf-call-iptables. Pods on other nodes are fine, so it stays latent until something like CoreDNS is rescheduled onto the node, and then every runner pod on it loses DNS and cannot reach GitHub.

The cluster role now has tasks/colima_kernel.yml, included from runtime.yml once the Colima VM answers, whatever github_runner_cluster_runtime_autostart says. Through colima ssh --profile <profile> it writes /etc/modules-load.d/br_netfilter.conf and /etc/sysctl.d/90-github-runner-br-netfilter.conf in the VM, runs modprobe br_netfilter when /proc/sys/net/bridge is absent, and sets net.bridge.bridge-nf-call-iptables and -ip6tables to 1 when they differ. A second run changes nothing, and --check reports each change and makes none.

The Linux paths need nothing new. A native node already runs ExecStartPre=-/sbin/modprobe br_netfilter (k3s-agent.service.j2), and github_runner_linux_host_k3s_prerequisites loads the module and sets the same sysctls with boot files. A Compose node on a real Linux host relies on the Docker daemon, which loads br_netfilter and sets bridge-nf-call-iptables itself when it sets up a bridge network (setup_bridgenetfiltering.go in moby). k3s tries modprobe br_netfilter inside the node's container too (pkg/agent/syssetup/setup.go), but the Compose file mounts no /lib/modules there, so that attempt only warns; that is why a Colima VM, where nothing else loads the module, was the one missing it. A Linux Compose host that sets github_runner_linux_host_k3s_prerequisites: true gets it from the linux host role regardless.

Tests are in tests/unit/test_runtime_autostart.py, against a stand-in VM behind colima ssh. Removing the include, the file write, the modprobe or the sysctl task each fails at least one of them.

A pod that talks to a Service whose only backend pod is on the same node
gets no reply when the Colima VM has not loaded br_netfilter, because
bridged hairpin traffic skips the reverse NAT without
bridge-nf-call-iptables. Pods on other nodes keep working, so the gap
stays latent until a single-backend Service such as CoreDNS is
rescheduled onto the node, and then every runner pod on it loses DNS.

On a Colima host the cluster role now writes a modules-load.d file and a
sysctl.d file in the VM, loads the module when the VM has no bridge
sysctl directory, and sets both bridge sysctls when they differ, through
colima ssh on the host's profile. It runs whatever the autostart setting
says, changes nothing on a second run, and reports each change under
--check.
@Mearman
Mearman marked this pull request as ready for review November 2, 2026 17:56
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-11-02T17:56:12.639793Z
We couldn’t complete this review. Comment @codex security review to try again.
c3c6791 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@Mearman
Mearman merged commit 777764b into main Nov 2, 2026
27 checks passed
@Mearman
Mearman deleted the fix/br-netfilter-colima-vm branch November 2, 2026 17:58
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.18.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant