Skip to content

Add ipset kernel modules for k3s NetworkPolicy support#51

Merged
kvinwang merged 1 commit intomainfrom
feat/ipset-kernel-modules
Mar 20, 2026
Merged

Add ipset kernel modules for k3s NetworkPolicy support#51
kvinwang merged 1 commit intomainfrom
feat/ipset-kernel-modules

Conversation

@kvinwang
Copy link
Copy Markdown
Collaborator

Summary

  • Add CONFIG_IP_SET and related hash/bitmap type kernel modules to dstack-docker.cfg
  • Add corresponding kernel-module-ip-set-*, kernel-module-xt-set, kernel-module-xt-nflog, kernel-module-xt-physdev packages to rootfs
  • These modules are required by kube-router (k3s embedded network policy controller) to enforce NetworkPolicy rules

Problem

When running k3s in a sysbox container on dstack 0.5.8, kube-router silently skips starting the network policy controller:

Skipping network policy controller start, ipset save failed: ipset v7.16: Kernel error received: Invalid argument

Root cause: CONFIG_IP_SET is not set in the dstack kernel, so the ip_set netlink interface is unavailable.

Test plan

  • Built with Yocto (cd build && ../build.sh guest)
  • Deployed k3s in sysbox on dstack-dev-0.5.8 CVM
  • Verified kube-router starts network policy controller successfully
  • Verified NetworkPolicy default-deny blocks traffic between pods
  • Verified NetworkPolicy allow rule permits traffic
  • Verified modules survive VM restart

kube-router (k3s embedded network policy controller) requires ipset
kernel support to enforce NetworkPolicy rules. Without these modules,
kube-router silently skips starting the network policy controller with:
"Skipping network policy controller start, ipset save failed"

Adds CONFIG_IP_SET and related hash/bitmap type modules, plus
xt_set (iptables set match), xt_physdev, and xt_nflog.
@kvinwang kvinwang merged commit 8977e04 into main Mar 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant