authoravatarclover caruso<git@paperclover.net>2026-11-22 13:28:45-08:00
committeravatarclover caruso<git@paperclover.net>2026-11-22 20:28:52-08:00
logef23f017495891a92224a6ae07b2e0f4953aee5d
treef48b1189e3e0fb81bd6c9bdefe971f4e13fafbf1
parentae6bbd8f709665dd637e4fb32533cd24dac7369f
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Provide the sandbox network through Nomad CNI

The Podman driver cannot join a named Podman network, so the sandbox bridge is a CNI network that jobs select with a group network mode. Assisted-by: claude-sonnet-5.5

1 files changed, 9 insertions(+), 5 deletions(-)

nixos/snowglobe.nix+9-5
......@@ -42,12 +42,16 @@ in
4242 '';
4343
4444 # Containers on `sandbox` reach the public internet and PostgreSQL, nothing else on the host or LAN.
45 systemd.services.podman-sandbox-network = {
46 wantedBy = [ "multi-user.target" ];
47 before = [ "nomad.service" ];
48 serviceConfig = { Type = "oneshot"; RemainAfterExit = true; };
49 script = "${config.virtualisation.podman.package}/bin/podman network create --ignore --disable-dns --subnet 10.89.0.0/24 --interface-name sandbox0 sandbox";
45 environment.etc."cni/net.d/sandbox.conflist".text = builtins.toJSON {
46 cniVersion = "1.0.0";
47 name = "sandbox";
48 plugins = [
49 { type = "bridge"; bridge = "sandbox0"; isGateway = true; ipMasq = true; ipam = { type = "host-local"; ranges = [ [ { subnet = "10.89.0.0/24"; } ] ]; routes = [ { dst = "0.0.0.0/0"; } ]; }; }
50 { type = "portmap"; capabilities.portMappings = true; snat = true; }
51 ];
5052 };
53 services.nomad.settings.client.cni_path = "${pkgs.cni-plugins}/bin";
54 services.nomad.settings.client.cni_config_dir = "/etc/cni/net.d";
5155 networking.firewall.interfaces.sandbox0.allowedTCPPorts = [ 15432 ];
5256 networking.firewall.extraStopCommands = ''
5357 iptables -t raw -D PREROUTING -i sandbox0 -j sandbox-egress 2>/dev/null || true