[NixOS] Try to connect jimi-hendnix to ryzen-shine in k3s
This commit is contained in:
parent
1003c33dee
commit
f00d9bdb12
@ -1,23 +1,44 @@
|
|||||||
{ config, makeEnable, ... }:
|
{ config, lib, ... }:
|
||||||
makeEnable config "myModules.railbird-k3s" false {
|
with lib;
|
||||||
services.k3s = {
|
let cfg = config.myModules.railbird-k3s;
|
||||||
enable = true;
|
in {
|
||||||
role = "server";
|
options = {
|
||||||
clusterInit = true;
|
enable = mkEnableOption "railbird k3s";
|
||||||
containerdConfigTemplate = ''
|
serverAddr = {
|
||||||
{{ template "base" . }}
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
|
};
|
||||||
privileged_without_host_devices = false
|
};
|
||||||
runtime_engine = ""
|
config = {
|
||||||
runtime_root = ""
|
age.secrets."1896Folsom-k3s-token.age".file = ./secrets/1896Folsom-k3s-token.age;
|
||||||
runtime_type = "io.containerd.runc.v2"
|
services.dockerRegistry = {
|
||||||
|
|
||||||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
|
|
||||||
BinaryName = "/run/current-system/sw/bin/nvidia-container-runtime"
|
|
||||||
'';
|
|
||||||
gracefulNodeShutdown = {
|
|
||||||
enable = true;
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
../configuration.nix
|
../configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
myModules.railbird-k3s = {
|
||||||
|
enable = true;
|
||||||
|
serverAddr = "https://ryzen-shine.local:6433";
|
||||||
|
};
|
||||||
myModules.base.enable = true;
|
myModules.base.enable = true;
|
||||||
myModules.desktop.enable = true;
|
myModules.desktop.enable = true;
|
||||||
myModules.xmonad.enable = true;
|
myModules.xmonad.enable = true;
|
||||||
@ -18,7 +22,6 @@
|
|||||||
myModules.postgres.enable = true;
|
myModules.postgres.enable = true;
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
myModules.nvidia.enable = true;
|
myModules.nvidia.enable = true;
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
features.full.enable = true;
|
features.full.enable = true;
|
||||||
myModules.kubelet.enable = false;
|
myModules.kubelet.enable = false;
|
||||||
|
myModules.railbird-k3s.enable = true;
|
||||||
myModules.nvidia.enable = true;
|
myModules.nvidia.enable = true;
|
||||||
# Needed for now because monitors have different refresh rates
|
# Needed for now because monitors have different refresh rates
|
||||||
myModules.xmonad.picom.vSync.enable = false;
|
myModules.xmonad.picom.vSync.enable = false;
|
||||||
|
BIN
nixos/secrets/1896Folsom-k3s-token.age
Normal file
BIN
nixos/secrets/1896Folsom-k3s-token.age
Normal file
Binary file not shown.
@ -13,5 +13,6 @@ in
|
|||||||
"gitea-runner-token.mac-demarco-mini.age".publicKeys = keys.agenixKeys ++ keys.railbird-sf;
|
"gitea-runner-token.mac-demarco-mini.age".publicKeys = keys.agenixKeys ++ keys.railbird-sf;
|
||||||
"nextcloud-admin.age".publicKeys = keys.agenixKeys;
|
"nextcloud-admin.age".publicKeys = keys.agenixKeys;
|
||||||
"ryzen-shine-kubernetes-token.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;
|
"api_service_account_key.json.age".publicKeys = keys.agenixKeys;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user