kinvolk/kube-spawn

'kube-spawn start' does not work as a systemd service

Opened this issue · 0 comments

alban commented

To start the nodes, kube-spawn start executes systemd-nspawn directly without systemd-run. So the systemd-nspawn processes stay in the same cgroup. When I run systemd-run kube-spawn start the cgroup could be for example /system.slice/run-r6c31c44087e7466ba0a5174e650f4777.service.

As soon as the command kube-spawn start finishes, systemd detects that the main pid of the service terminated so it kills all other processes of the cgroup, like systemd-nspawn. In effect, it kills the nodes.

Instead, pkg/cnispawn/spawn.go:Spawn() should start systemd-nspawn via systemd-run, so that the lifecycle of the nodes are not linked to the lifecycle of the kube-spawn start command.

This should work both when kube-spawn start is executed from the session in a terminal and as a systemd service.