added k3s

This commit is contained in:
2026-02-03 18:30:04 -05:00
parent d18a3752c0
commit 0bd3febaa6
3 changed files with 34 additions and 1 deletions

5
README.md Normal file
View File

@@ -0,0 +1,5 @@
# Nix Homelab
This is the config of a nix based homelab server. Currently a work in progress.
## Clustering with K3s
K3s is a simplified version of Kubernetes.

View File

@@ -10,6 +10,7 @@
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./homeassistant.nix ./homeassistant.nix
./k3-cluster.nix
]; ];
# Bootloader. # Bootloader.
@@ -136,7 +137,7 @@
8123 8123
config.services.home-assistant.config.http.server_port config.services.home-assistant.config.http.server_port
]; ];
# networking.firewall.allowedUDPPorts = [ ... ]; networking.firewall.allowedUDPPorts = [];
# Or disable the firewall altogether. # Or disable the firewall altogether.
# networking.firewall.enable = false; # networking.firewall.enable = false;

27
k3-cluster.nix Normal file
View File

@@ -0,0 +1,27 @@
{
# For the first node:
services.k3s = {
enable = true;
role = "server";
token = "<randomized common secret>";
clusterInit = true;
};
# All subsequent nodes:
# services.k3s = {
# enable = true;
# role = "server"; # Or "agent" for worker only nodes
# token = "<randomized common secret";
# serverAddr = "https://<ip of first node>:6443";
# };
networking.firewall.allowedTCPPorts = [
6443
2379
2380
];
networking.firewall.allowedUDPPorts = [
8472
];
}