# A node module for a VM test whose script gives the hive bridge a client in the # network namespace `agent`. The namespace is created before k3s starts, so # the `ip netns add` that makes `/run/netns` a mount point has run before any # pod's namespace is mounted there. Run later, it mounts `/run/netns` over the # pods' namespaces, and containerd then cannot remove them: a deleted pod stays # Terminating until the node reboots. { pkgs, ... }: { systemd.services.agent-netns = { wantedBy = [ "multi-user.target" ]; before = [ "k3s.service" ]; path = [ pkgs.iproute2 ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; }; script = "ip netns add agent"; }; }