Configure clustering with k3s

This commit is contained in:
JuliusFreudenberger 2025-08-17 02:53:39 +02:00
parent 31267fa34c
commit 2249b4cc58
4 changed files with 14 additions and 1 deletions

View file

@ -21,6 +21,9 @@
networking.hostName = "kube01"; # Define your hostname.
services.k3s = {
clusterInit = true;
};
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.

View file

@ -20,6 +20,11 @@
networking.hostName = "kube02"; # Define your hostname.
services.k3s = {
serverAddr = "https://kube01:6443";
clusterInit = false;
};
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
# Most users should NEVER change this value after the initial install, for any reason,

View file

@ -21,6 +21,10 @@
networking.hostName = "kube03"; # Define your hostname.
services.k3s = {
serverAddr = "https://kube01:6443";
clusterInit = false;
};
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.

View file

@ -7,7 +7,6 @@
services.k3s = {
enable = true;
role = "server";
clusterInit = true;
token = "verysecrettoken";
extraFlags = toString ([
"--write-kubeconfig-mode \"0644\""
@ -19,6 +18,8 @@
networking.firewall.allowedTCPPorts = [
6443
2379
2380
];
networking.firewall.allowedUDPPorts = [
8472