add k3s services

This commit is contained in:
2026-03-13 19:11:58 +01:00
parent 31c7ad6454
commit a1d1c767e3
3 changed files with 132 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
k3s
];
environment.sessionVariables = {
KUBECONFIG = "$HOME/.kube/config";
};
services.k3s = {
enable = true;
role = "agent";
serverAddr = "https://192.168.1.89:6443";
tokenFile = "/var/lib/rancher/k3s/agent/token";
};
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
networking.firewall = {
allowedTCPPorts = [ 10250 22 ];
allowedUDPPorts = [ 8472 ];
};
}