Skip to content

Running kind/systemd in krun container fails #223

@ctrox

Description

@ctrox

I tried running kind with the podman runtime set to krun and I'm getting the following error:

$ KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --retain
using podman due to KIND_EXPERIMENTAL_PROVIDER
enabling experimental podman provider
Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.31.0) 🖼
 ✗ Preparing nodes 📦
ERROR: failed to create cluster: could not find a log line that matches "Reached target .*Multi-User System.*|detected cgroup v1"

Looking at the logs of the node container I see the following:

$ podman logs kind-control-plane
INFO: changing snapshotter from "overlayfs" to "fuse-overlayfs"
INFO: enabling containerd-fuse-overlayfs service
Created symlink /etc/systemd/system/multi-user.target.wants/containerd-fuse-overlayfs.service → /etc/systemd/system/containerd-fuse-overlayfs.service.
INFO: ensuring we can execute mount/umount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: detected cgroup v2
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: setting iptables to detected mode: legacy
INFO: detected IPv4 address:
INFO: detected IPv6 address:
INFO: starting init
Couldn't find an alternative telinit implementation to spawn.

So kind fails at starting systemd inside the container. I have verified this by using a very minimal systemd container as described here: https://developers.redhat.com/blog/2019/04/24/how-to-run-systemd-in-a-container#enter_podman

Running such a container results in the same error. I think the issue boils down to krun using PID 1 for /init.krun and not the container entrypoint as other runtimes (e.g. crun) do. So I'm not entirely sure this is fixable at all.

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