Skip to content

Support pinning/managing a custom runc binary (bundled runc's masked-path mount fails on older kernels) #8097

Description

@miltieIV2

Summary

k0s bundles and unconditionally re-stages its own runc binary at /var/lib/k0s/bin/runc on every install/start, with no supported way to pin an alternate version or opt out of this management. On older kernels, the bundled runc fails because it relies on a tmpfs masked-path mount technique (nr_blocks=1,nr_inodes=1) that isn't supported there.

Environment / observed behavior

  • Fleet of legacy hosts running an older LTS kernel line, bumped to 4.4 (the newest available via the distro's own backport path) specifically to meet a runtime-security agent's minimum kernel requirement.
  • With k0s's bundled runc, worker/controller nodes fail to start containers with a masked-path mount error on this kernel.
  • Manually swapping in runc v1.2.9 (which predates the masking technique) at /var/lib/k0s/bin/runc fixes it completely — confirmed stable in production across dozens of hosts.
  • However, k0s re-stages its own bundled runc on every start, silently reverting the fix. Confirmed this happens more than once per lifecycle: once immediately at install, and again some seconds after control-plane readiness on a controller+worker node (timing varies with host load, observed ~8-10s on an otherwise-idle host). There's no config option to tell k0s "don't manage runc" or "use this specific runc binary."

Current workaround (fragile)

We run a small always-on daemon, triggered on every k0scontroller/k0sworker start (not a one-shot post-install hook), that polls the runc binary's checksum and re-swaps it whenever k0s overwrites it. A one-shot swap-after-install approach was tried first and missed the later re-stage entirely. This works but is a real hack around the absence of first-class support, and cost significant time to discover and get right.

Feature request

Either of these would remove the need for the workaround:

  1. A config option (e.g. under spec.k0s.config.spec.workerProfiles, or a top-level key) to point k0s at a specific runc binary path/version instead of always using the bundled one — similar in spirit to how k0sctl's k0sBinaryPath lets you bring your own k0s binary.
  2. Or, at minimum, a way to disable k0s's own runc management entirely (skip re-staging if a runc binary already exists at the target path), so external tooling can manage it without fighting k0s's own reconciliation on every start.

Happy to provide more detail on the exact masked-path mount failure if useful (kernel 4.4; bundled runc version failed, v1.2.9 confirmed working).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions