✨ add k3s
This commit is contained in:
8
nix/modules/k3s/agent.nix
Normal file
8
nix/modules/k3s/agent.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
services.k3s = {
|
||||
role = "agent";
|
||||
serverAddr = "https://<ip of first node>:6443";
|
||||
};
|
||||
}
|
11
nix/modules/k3s/common.nix
Normal file
11
nix/modules/k3s/common.nix
Normal file
@ -0,0 +1,11 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
services.k3s = {
|
||||
enable = true;
|
||||
tokenFile = config.sops.secrets.k3s-token.path;
|
||||
};
|
||||
sops.secrets.k3s-token = {
|
||||
owner = "root";
|
||||
mode = "0400";
|
||||
};
|
||||
}
|
7
nix/modules/k3s/server.nix
Normal file
7
nix/modules/k3s/server.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
services.k3s = {
|
||||
role = "server";
|
||||
clusterInit = true;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user