Add k3s, move to subfolder

This commit is contained in:
Julius 2022-05-20 22:06:13 +02:00
parent a423603e26
commit 0cf926e8fa
Signed by: j00lz
GPG key ID: AF241B0AA237BBA2
11 changed files with 37 additions and 0 deletions

View file

@ -69,6 +69,14 @@
tags = [ "website" "system" ]; tags = [ "website" "system" ];
}; };
}; };
k3s = {
imports = [ ./machines/k3s ];
deployment = {
targetHost = "k3s.lxd";
tags = [ "k3s" ];
};
};
}; };
devShells.x86_64-linux.default = pkgs.mkShell { devShells.x86_64-linux.default = pkgs.mkShell {

View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }: {
imports = [ ../../common ../../common/lxc.nix ];
networking.hostName = "k3s";
system.stateVersion = "21.11";
# Additional packages
environment.systemPackages = with pkgs; [ iptables vim ];
# Disable the firewall as we need all the ports
networking.firewall.enable = false;
# Force-enable Cgroupv2
systemd.enableUnifiedCgroupHierarchy = lib.mkForce true;
# Ensure `mount` and `grep` are available
systemd.services.k3s.path = [ pkgs.gnugrep pkgs.utillinux ];
# Enable k3s as a master node
services.k3s = {
enable = true;
role = "server";
extraFlags = builtins.toString [
"--data-dir=/var/lib/k3s" # Set data dir to var lib
"--cluster-init" # Enable embedded etcd
"--cluster-cidr=10.69.0.0/16" # the default of 10.42.0.0/16 clashes with my own network
];
};
}