From d6cca37b8eee3d1bb2ef72a8e9389812de474197 Mon Sep 17 00:00:00 2001 From: NyxErinys Date: Wed, 27 May 2026 02:10:33 -0500 Subject: [PATCH] pod to deployment --- modules/k3s/default.nix | 2 +- modules/k3s/deployments/ubuntu-test.nix | 93 ++++++++++++++----------- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/modules/k3s/default.nix b/modules/k3s/default.nix index 47a8205..4e37c91 100644 --- a/modules/k3s/default.nix +++ b/modules/k3s/default.nix @@ -55,7 +55,7 @@ in systemd.services.k3s = { restartTriggers = [ - (builtins.attrNames config.services.k3s.manifests) + (builtins.toJSON config.services.k3s.manifests) ]; stopIfChanged = false; after = [ "rpcbind.service" "network-online.target" ]; diff --git a/modules/k3s/deployments/ubuntu-test.nix b/modules/k3s/deployments/ubuntu-test.nix index 687da27..f7a2964 100644 --- a/modules/k3s/deployments/ubuntu-test.nix +++ b/modules/k3s/deployments/ubuntu-test.nix @@ -2,51 +2,62 @@ { ubuntu-test.content = [ { - apiVersion = "v1"; - kind = "Pod"; - metadata.name = "ubuntu-test"; + apiVersion = "apps/v1"; + kind = "Deployment"; + metadata = { + name = "ubuntu-test"; + labels.app = "ubuntu-test" + }; spec = { - containers = [ - { - name = "ubuntu-test"; - image = "ubuntu:latest"; - command = [ "tail" "-f" "/dev/null" ]; - volumeMounts = [ + selector.matchLabels.app = "ubuntu-test"; + template = { + metadata = { + labels.app = "ubuntu-test"; + }; + spec = { + containers = [ { - mountPath = "/test"; - name = "test"; - subPath = "ubuntu-test"; - } - { - mountPath = "/test2"; - name = "iscsi"; - } - { - mountPath = "/test3"; - name = "iscsi"; - subPath = "test"; + name = "ubuntu-test"; + image = "ubuntu:26.04"; + command = [ "tail" "-f" "/dev/null" ]; + volumeMounts = [ + { + mountPath = "/test"; + name = "test"; + subPath = "ubuntu-test"; + } + { + mountPath = "/test2"; + name = "iscsi"; + } + { + mountPath = "/test3"; + name = "iscsi"; + subPath = "test"; + } + ]; } ]; - } - ]; - volumes = [ - { - name = "test"; - persistentVolumeClaim = { - claimName = "nfs-main-pvc"; - }; - } - { - name = "iscsi"; - iscsi = { - targetPortal = "10.5.0.2:3260"; - iqn = "iqn.2026-01.dev.nyxerinys:poseidon.authentik"; - lun = 0; - fsType = "xfs"; - readOnly = false; - }; - } - ]; + volumes = [ + { + name = "test"; + persistentVolumeClaim = { + claimName = "nfs-main-pvc"; + }; + } + { + name = "iscsi"; + iscsi = { + targetPortal = "10.5.0.2:3260"; + iqn = "iqn.2026-01.dev.nyxerinys:poseidon.authentik"; + lun = 0; + fsType = "xfs"; + readOnly = false; + }; + } + ]; + }; + }; }; } ];