Skip to content

k8s: support Sysbox-CE on Flatcar 4593+ (kernel 6.x)#153

Open
Till0196 wants to merge 4 commits into
nestybox:masterfrom
Till0196:feat/k8s-flatcar-4593-ce
Open

k8s: support Sysbox-CE on Flatcar 4593+ (kernel 6.x)#153
Till0196 wants to merge 4 commits into
nestybox:masterfrom
Till0196:feat/k8s-flatcar-4593-ce

Conversation

@Till0196
Copy link
Copy Markdown

This is the Flatcar-specific follow-up to #152 (containerd drop-in for k3s / RKE2). On a 6.x Flatcar node running RKE2, the install dies at the EE-only guard in do_distro_adjustments() before #152's drop-in logic gets a chance to run.

The historical reason for that guard was shiftfs being EE-exclusive (the sysbox-flatcar-preview build), but on 6.x:

  • sysbox-flatcar-preview shiftfs.ko no longer applies (it isn't maintained for the 6.x line; module load fails).
  • The kernel provides idmap mounts in mainline, which sysbox-runc uses transparently in place of shiftfs.

So shiftfs isn't reachable on 6.x even if you wanted it, and the alternative (idmap) isn't EE-restricted. This PR tries to make CE on 6.x Flatcar work:

  1. Skip install_sysbox_deps_flatcar on kernels ≥ 6.x — the function only installs the shiftfs preview, which can't build on 6.x. Fall back to bin/generic artifacts.
  2. Adjust the containerd drop-in BinaryName to /opt/bin/sysbox-runc on Flatcar (Flatcar's /usr is read-only). This piggybacks on the existing Flatcar path-rewrite sed pile in do_distro_adjustments().
  3. The EE-only die block is taken out — see the paragraph below; if the policy still applies for reasons other than shiftfs availability, this is the bullet to flag and I'll drop the change.

I don't have full context on whether the "Flatcar = EE only" policy from PR #48 (2021-09) still applies for non-shiftfs reasons (licensing, support scope, etc.). If there's something I'm missing, happy to adjust or drop the relevant parts — the verification below is just to show that the technical pieces line up.

Verification

Tested on Flatcar 4593.2.1 + kernel 6.12.87 + RKE2 v1.36.0+rke2r1 + containerd 2.2.3-k3s1 + Cilium CNI, with stock upstream sysbox-runc master. A statically-built fusermount3 was placed on the host at /opt/bin/fusermount3 out-of-band (built from Till0196/fusermount3-static; see the fusermount note below for why):

Scenario Result
Sysbox-CE install via daemonset on Flatcar 4593+ Success (currently dies on die guard)
runtimeClassName: sysbox-runc + hostUsers: false (alpine) Running; sysfs/proc/sysbox-fs FUSE all functional
Same + docker:dind inner workload Running; bridge net + outbound functional
runtimeClassName: sysbox-runc on EE × Flatcar 4593+ (kernel 6.x) Continues to work (no regression for EE flow; only adds the 6.x skip branch)

Open items / known limitations

  • fusermount3 still needs to be reachable on the host. sysbox-fs in the v0.7.0 deb invokes fusermount3 to set up its FUSE mounts, and Flatcar's base image doesn't ship one. Until now install_sysbox_deps_flatcar supplied it alongside the shiftfs preview; skipping that function on 6.x removes that path.

    For the verification above I built a statically-linked fusermount3 (Till0196/fusermount3-static — a small wrapper around libfuse's util/fusermount.c for minimal distros like Flatcar / Talos / distroless) and dropped it into /opt/bin/ out-of-band. That's enough to make sysbox-fs work.

    One option going forward is for the daemonset to bundle a small static fusermount3 independently of the shiftfs flow. I left it out of this PR because adding a binary the project then has to maintain feels like a maintenance-cost call that should be on your side rather than mine.

    As a separate, parallel attempt, nestybox/fuse#10 proposes letting sysbox-fs call mount(2) directly when running as root, so the fusermount3 binary isn't needed at all. I also ran the FUSE-touching scenarios above with a sysbox-fs built against that branch and no fusermount3 on the host — they passed.

    If Flatcar support is going to continue, my impression is that the fuse-side route is the cheaper integration overall: a small library patch, with no extra static binary to build, ship, and keep in sync with the deb. So between the two options above, I'd softly lean toward picking up the fuse PR rather than adding a static fusermount3 to the daemonset — but that's a judgment call from your side.

  • K8s version: tested on v1.36, which is currently outside is_supported_k8s_version's allowlist. Allowlist extension is tracked in Kubernetes 1.33 support sysbox#961, separately.

Till0196 added 4 commits May 19, 2026 18:25
k3s and RKE2 with containerd 2.x regenerate /etc/containerd/config.toml
on every restart, so the existing dasel-based config.toml editing path
is wiped out on the next reboot. The supported extension point is the
config-v3 drop-in directory (config-v3.toml.d), which is read after
the generated base config and merged on top of it.

Detect k3s / RKE2 via systemd, resolve the per-distro drop-in dir
under /var/lib/rancher/<dist>/agent/etc/containerd/, and write a
minimal sysbox-runc runtime block as a standalone drop-in. The
drop-in body is shipped as a template (config/containerd-sysbox-
dropin.toml.tmpl) and rendered with a sed substitution at install
time so the TOML lives next to the other k8s config artifacts rather
than embedded in the deploy script. Vanilla containerd nodes keep
their existing config.toml-editing path.

unconfig_containerd_for_sysbox is updated to mirror the new path:
on k3s / RKE2 it simply removes the drop-in and restarts the wrapper
service.
The drop-in only ever substituted the sysbox-runc binary path. Carrying
it as a .tmpl with an @SYSBOX_RUNC_PATH@ placeholder is heavier than
needed: rename it to a plain .toml that is valid on its own and hard-code
BinaryName to /usr/bin/sysbox-runc (the only path the installer ever
writes on non-Flatcar nodes). Simplify write_containerd_sysbox_dropin()
to a straight cp. config_containerd_for_sysbox() still computes
sysbox_runc_path for the legacy dasel-based containerd.conf branch.
Flatcar Container Linux 4593 and later ship a 6.x kernel where the
sysbox-flatcar-preview shiftfs.ko no longer applies; the kernel
provides idmap mounts instead, which sysbox-runc uses transparently.

Mirror the non-Flatcar branch's kernel-version gate in
install_sysbox_deps so shiftfs installation is skipped above the
shiftfs_max_kernel_ver. Also fall back to the generic binary
directory for Sysbox-CE on Flatcar, since the per-release flatcar-*
artifact dir only exists in the EE build that depends on shiftfs.
Drop the EE-only guard in do_distro_adjustments(). The guard was added
when shiftfs was the only path to make sysbox work on Flatcar, and
shiftfs was an EE-exclusive preview build. On kernel 6.x Flatcar ships
mainline idmap mount support, which sysbox-runc uses transparently; the
EE-only justification no longer holds, and the companion change to
skip install_sysbox_deps_flatcar() above the shiftfs ceiling already
makes the install path correct for CE on 6.x.

Also fold the Flatcar-specific BinaryName rewrite for the containerd
drop-in into do_distro_adjustments(), matching how every other Flatcar
path override (systemd units, crio.conf, helper scripts) is handled in
the same function.

Addresses: nestybox/sysbox#995
Copilot AI review requested due to automatic review settings May 19, 2026 10:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Sysbox-CE installs on Flatcar 4593+ (kernel 6.x) by removing the EE-only guard in the Flatcar install path and by routing the new containerd drop-in (introduced for k3s/RKE2 in #152) through the existing Flatcar path-rewrite logic so BinaryName lands at /opt/bin/sysbox-runc. On 6.x kernels the shiftfs-preview install is skipped because the prebuilt module no longer applies and idmap mounts cover the same use cases.

Changes:

  • get_artifacts_dir: route Sysbox-CE on Flatcar to bin/generic (no Flatcar-specific shiftfs build is shipped for CE).
  • install_sysbox_deps: on Flatcar, only call install_sysbox_deps_flatcar when kernel < 6.3; otherwise skip with a clear message.
  • do_distro_adjustments: drop the EE-only die, and sed-rewrite containerd-sysbox-dropin.toml's BinaryName to /opt/bin/sysbox-runc (the CE Dockerfile and the containerd drop-in/loader logic from #152 are also included in this diff).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
k8s/scripts/sysbox-deploy-k8s.sh Flatcar CE artifact routing, kernel-gated shiftfs install, EE-only guard removal, Flatcar path rewrite for the containerd drop-in, and (from #152) k3s/RKE2 drop-in install/uninstall path.
k8s/Dockerfile.sysbox-ce Copies the new containerd-sysbox-dropin.toml into the daemonset image.
k8s/config/containerd-sysbox-dropin.toml New static drop-in registering sysbox-runc under the containerd v3 plugin key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# kernel provides idmap mounts), so the prebuilt shiftfs.ko from
# sysbox-flatcar-preview no longer applies.
if semver_lt $kversion 6.3; then
install_sysbox_deps_flatcar
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.

2 participants