Documentation
¶
Overview ¶
Package k3dkmsg lets `k3d cluster create` work on a Linux host that has no /dev/kmsg, as a kata or gVisor sandbox does.
k3s's kubelet opens /dev/kmsg for its OOM watcher and exits fatally when it cannot ("open /dev/kmsg: no such file or directory"). k3s then shuts down about two seconds after it started, the k3d entrypoint keeps the container "running", `--wait` hangs for its whole timeout, and :6443 refuses connections — which reads as a networking failure and is not one.
Docker's --privileged copies the HOST's /dev nodes into a container, so a host without /dev/kmsg gives the node none either. The fix is a character device (1:11) made by mknod under forge's cache directory and bind-mounted over /dev/kmsg in every server and agent node. A host that has /dev/kmsg is left exactly as it is.
Index ¶
Constants ¶
const HostPath = "/dev/kmsg"
HostPath is the device k3s's kubelet needs.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Host ¶
type Host struct {
GOOS string
Euid int
DockerHost string
// Dir is the forge-owned directory the device file is made in.
Dir string
Stat func(path string) (State, error)
Run func(name string, args ...string) error
Remove func(path string) error
Mkdir func(path string) error
}
Host is everything AddArgs reads from or does to the machine, so a test supplies all of it.