initialize k3s templates

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
ahuston-0 2024-05-25 15:36:40 -04:00
parent 3a61c7522d
commit 9985fc8778
No known key found for this signature in database
GPG Key ID: 1FACF4075E3212F7
5 changed files with 41 additions and 16 deletions

View File

@ -4,6 +4,7 @@
rad-dev = rec {
systems = import ./systems.nix { inherit lib; };
microvm = import ./microvms.nix { inherit lib; };
# any(), but checks if any value in the list is true
#
# args:

View File

@ -1 +1,5 @@
{ ... }: { }
{ ... }:
{
imports = [ ./k3s-common.nix ];
services.k3s.role = "agent";
}

View File

@ -0,0 +1,15 @@
{
config,
lib,
pkgs,
...
}:
{
services.k3s = {
enable = true;
extraFlags = "--cluster-cidr 192.168.69.0/24";
# tokenFile = #TODO: set this up after building the first node lol
# serverAddr =
};
}

View File

@ -1 +1,6 @@
{ ... }: { }
{ ... }:
{
imports = [ ./k3s-common.nix ];
services.k3s.role = "server";
}

View File

@ -6,13 +6,14 @@
...
}:
let
inherit (lib.rad-dev.microvm) genFromList;
inherit (lib.rad-dev.microvm) genK3SFromList;
in
{
# rad-dev.microvm-host.enable = true;
rad-dev.microvm-host.vms = (
genFromList (src + "/modules/opt/k3s-server.nix") (src + "/modules/opt/k3s-agent.nix") [
rad-dev.microvm-host.vms =
genK3SFromList (src + "/modules/opt/k3s-server.nix") (src + "/modules/opt/k3s-agent.nix")
[
{
host = "ph-server-1";
ipv4 = "192.168.69.10";
@ -22,6 +23,5 @@ in
host = "ph-agent-1";
ipv4 = "192.168.69.30";
}
]
);
];
}