[NixOS] Try to connect jimi-hendnix to ryzen-shine in k3s

This commit is contained in:
Ivan Malison 2024-09-30 16:35:50 -06:00
parent 1003c33dee
commit f00d9bdb12
5 changed files with 46 additions and 20 deletions

View File

@ -1,23 +1,44 @@
{ config, makeEnable, ... }:
makeEnable config "myModules.railbird-k3s" false {
services.k3s = {
enable = true;
role = "server";
clusterInit = true;
containerdConfigTemplate = ''
{{ template "base" . }}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
privileged_without_host_devices = false
runtime_engine = ""
runtime_root = ""
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
BinaryName = "/run/current-system/sw/bin/nvidia-container-runtime"
'';
gracefulNodeShutdown = {
{ config, lib, ... }:
with lib;
let cfg = config.myModules.railbird-k3s;
in {
options = {
enable = mkEnableOption "railbird k3s";
serverAddr = {
type = lib.types.str;
default = "";
};
};
config = {
age.secrets."1896Folsom-k3s-token.age".file = ./secrets/1896Folsom-k3s-token.age;
services.dockerRegistry = {
enable = true;
listenAddress = "0.0.0.0";
port = 5279;
enableDelete = true;
enableGarbageCollect = true;
};
services.k3s = {
enable = true;
role = "server";
clusterInit = cfg.serverAddr == "";
serverAddr = cfg.serverAddr;
tokenFile = config.age.secrets."1896Folsom-k3s-token.age".path;
containerdConfigTemplate = ''
{{ template "base" . }}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
privileged_without_host_devices = false
runtime_engine = ""
runtime_root = ""
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
BinaryName = "/run/current-system/sw/bin/nvidia-container-runtime"
'';
gracefulNodeShutdown = {
enable = true;
};
};
};
}

View File

@ -5,6 +5,10 @@
../configuration.nix
];
myModules.railbird-k3s = {
enable = true;
serverAddr = "https://ryzen-shine.local:6433";
};
myModules.base.enable = true;
myModules.desktop.enable = true;
myModules.xmonad.enable = true;
@ -18,7 +22,6 @@
myModules.postgres.enable = true;
hardware.enableRedistributableFirmware = true;
myModules.nvidia.enable = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ];

View File

@ -7,6 +7,7 @@
features.full.enable = true;
myModules.kubelet.enable = false;
myModules.railbird-k3s.enable = true;
myModules.nvidia.enable = true;
# Needed for now because monitors have different refresh rates
myModules.xmonad.picom.vSync.enable = false;

Binary file not shown.

View File

@ -13,5 +13,6 @@ in
"gitea-runner-token.mac-demarco-mini.age".publicKeys = keys.agenixKeys ++ keys.railbird-sf;
"nextcloud-admin.age".publicKeys = keys.agenixKeys;
"ryzen-shine-kubernetes-token.age".publicKeys = keys.agenixKeys;
"1896Folsom-k3s-token.age".publicKeys = keys.agenixKeys;
"api_service_account_key.json.age".publicKeys = keys.agenixKeys;
}