added k3s
This commit is contained in:
5
README.md
Normal file
5
README.md
Normal 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.
|
||||
@@ -10,6 +10,7 @@
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./homeassistant.nix
|
||||
./k3-cluster.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
@@ -136,7 +137,7 @@
|
||||
8123
|
||||
config.services.home-assistant.config.http.server_port
|
||||
];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
networking.firewall.allowedUDPPorts = [];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
|
||||
27
k3-cluster.nix
Normal file
27
k3-cluster.nix
Normal 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
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user