From 13c8547b08f23b8676e1c7491ce7ee01cdf2a90d Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Wed, 3 Sep 2025 16:13:29 +0530 Subject: feat(os/pc/work): init k8s cluster --- os/cez/configuration.nix | 1 - os/pc/modules/work.nix | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'os') diff --git a/os/cez/configuration.nix b/os/cez/configuration.nix index a05f00e..debae56 100644 --- a/os/cez/configuration.nix +++ b/os/cez/configuration.nix @@ -1,4 +1,3 @@ -{ ... }: { imports = [ ../pc/configuration.nix diff --git a/os/pc/modules/work.nix b/os/pc/modules/work.nix index 9bd1d75..58aa4e0 100644 --- a/os/pc/modules/work.nix +++ b/os/pc/modules/work.nix @@ -15,4 +15,23 @@ in virtualisation.docker.enable = true; users.extraGroups.docker.members = [ user ]; + + systemd.services.k3s.path = [ pkgs.criu ]; + environment = { + variables.KUBECONFIG = "/etc/rancher/k3s/k3s.yaml"; + systemPackages = with pkgs; [ + kubernetes-helm + k9s + ]; + }; + services.k3s = { + gracefulNodeShutdown.enable = true; + enable = true; + clusterInit = true; + role = "server"; + extraFlags = [ + "--write-kubeconfig-group users" + "--write-kubeconfig-mode 0640" + ]; + }; } -- cgit v1.2.3