mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:36 +01:00
The physical hosts no longer need k3s or KubeVirt: aquamarine runs natively, the k3s-test masters run as microVMs and kana/ruby under libvirt. So drop the host cluster and split the shared parts out of the KubeVirt host module: - lib/genVmHostModule.nix: the host bits the VMs still need (br0 + the physical NIC as a bridge port, KVM, sysctls, earlyoom, libvirt, journald, stateVersion) - the three hosts use it and drop genK3sServerModule; also drop the longhorn workarounds (openiscsi + the /usr/local/bin tmpfile) and the virtctl package - remove lib/genKubeVirtHostModule.nix
36 lines
850 B
Nix
36 lines
850 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
mylib,
|
|
myvars,
|
|
disko,
|
|
...
|
|
}:
|
|
let
|
|
hostName = "kubevirt-shushou"; # Define your hostname.
|
|
|
|
coreModule = mylib.genVmHostModule {
|
|
inherit pkgs hostName;
|
|
inherit (myvars) networking;
|
|
};
|
|
in
|
|
{
|
|
imports = (mylib.scanPaths ./.) ++ [
|
|
disko.nixosModules.default
|
|
../disko-config/kubevirt-disko-fs.nix
|
|
../kubevirt-shoryu/hardware-configuration.nix
|
|
../kubevirt-shoryu/preservation.nix
|
|
coreModule
|
|
];
|
|
|
|
modules.btrbk.enable = true;
|
|
|
|
boot.kernelParams = [
|
|
# Use transparent huge pages on demand (madvise) instead of a fixed 1G hugetlb
|
|
# pool. The static pool cannot be overcommitted or shared with the host /
|
|
# other VMs, which stranded memory and blocked scheduling; the VMs now use
|
|
# ordinary memory (see the instancetypes in k8s-gitops).
|
|
"transparent_hugepage=madvise"
|
|
];
|
|
}
|