Add k8s-server configuration and deployment scripts

This commit is contained in:
2025-12-15 17:12:10 +01:00
parent cdf71a5ded
commit 0425868cdc
8 changed files with 291 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
{ config, pkgs, ... }:
{
########################################
# k3s Single-Node (Traefik disabled)
########################################
services.k3s = {
enable = true;
role = "server";
# Initialize single-server cluster and disable bundled Traefik ingress.
extraFlags = toString [
"--cluster-init"
"--disable=traefik"
"--flannel-backend=vxlan"
];
};
########################################
# Firewall for k3s
########################################
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [
6443 # Kubernetes API
10250 # Kubelet metrics
];
networking.firewall.allowedUDPPorts = [
8472 # flannel VXLAN
];
}