refactor(vars,hosts): networking & k3s clusters

This commit is contained in:
Ryan Yin
2024-03-23 01:42:17 +08:00
parent a3c6532376
commit 84c21ccd34
36 changed files with 336 additions and 571 deletions

21
lib/genK3sAgentModule.nix Normal file
View File

@@ -0,0 +1,21 @@
{
pkgs,
serverIp,
tokenFile,
...
}: let
package = pkgs.k3s_1_29;
in {
environment.systemPackages = [package];
services.k3s = {
enable = true;
inherit package tokenFile;
role = "agent";
serverAddr = "https://${serverIp}:6443";
# https://docs.k3s.io/cli/agent
extraFlags =
" --node-label=node-type=worker"
+ " --data-dir /var/lib/rancher/k3s";
};
}