Watch
0
0
Fork
You've already forked hyperhive
0

k8s vm tests: create the agent netns before k3s starts a pod, and delete pods strictly again

This commit is contained in:
atlas 2026-11-26 09:12:15 +01:00 • committed by mara
commit 898b02c5ad

View file

@ -0,0 +1,19 @@
# 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";
};
}