chore(hosts): retire the k3s cluster on the physical hosts

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
This commit is contained in:
Ryan Yin committed 2026-09-21 16:57:42 +08:00
1 parent 6e551770ac
commit cf2435e854
5 files changed
+11 -116

No files matched your search

+1 -31
View File
@@ -10,39 +10,10 @@ let
# MoreFine - S500Plus
hostName = "kubevirt-shoryu"; # Define your hostname.
coreModule = mylib.genKubeVirtHostModule {
coreModule = mylib.genVmHostModule {
inherit pkgs hostName;
inherit (myvars) networking;
};
k3sModule = mylib.genK3sServerModule {
inherit pkgs;
kubeconfigFile = "/home/${myvars.username}/.kube/config";
tokenFile = "/persistent/kubevirt-k3s-token";
# the first node in the cluster should be the one to initialize the cluster
clusterInit = true;
# use my own domain & kube-vip's virtual IP for the API server
# so that the API server can always be accessed even if some nodes are down
masterHost = "kubevirt-cluster-1.writefor.fun";
kubeletExtraArgs = [
"--cpu-manager-policy=static"
# https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/
# we have to reserve some resources for for system daemons running as pods or system services
# when cpu-manager's static policy is enabled
# the memory we reserved here is also for the kernel, since kernel's memory is not accounted in pods
"--system-reserved=cpu=1,memory=2Gi,ephemeral-storage=2Gi"
];
k3sExtraArgs = [
# IPv4 Private CIDR(full) - 172.16.0.0/12
# IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
# IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
# "--cluster-cidr=172.16.0.0/16,fdfd:cafe:00:0001::/64"
# "--service-cidr=172.17.0.0/16,fdfd:cafe:00:8001::/112"
];
nodeLabels = [
"node-purpose=kubevirt"
];
# flannel is disabled; Cilium provides the pod network.
};
in
{
imports = (mylib.scanPaths ./.) ++ [
@@ -51,7 +22,6 @@ in
./hardware-configuration.nix
./preservation.nix
coreModule
k3sModule
];
modules.btrbk.enable = true;
+1 -29
View File
@@ -9,37 +9,10 @@
let
hostName = "kubevirt-shushou"; # Define your hostname.
coreModule = mylib.genKubeVirtHostModule {
coreModule = mylib.genVmHostModule {
inherit pkgs hostName;
inherit (myvars) networking;
};
k3sModule = mylib.genK3sServerModule {
inherit pkgs;
kubeconfigFile = "/home/${myvars.username}/.kube/config";
tokenFile = "/persistent/kubevirt-k3s-token";
# use my own domain & kube-vip's virtual IP for the API server
# so that the API server can always be accessed even if some nodes are down
masterHost = "kubevirt-cluster-1.writefor.fun";
kubeletExtraArgs = [
"--cpu-manager-policy=static"
# https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/
# we have to reserve some resources for for system daemons running as pods or system services
# when cpu-manager's static policy is enabled
# the memory we reserved here is also for the kernel, since kernel's memory is not accounted in pods
"--system-reserved=cpu=1,memory=2Gi,ephemeral-storage=2Gi"
];
k3sExtraArgs = [
# IPv4 Private CIDR(full) - 172.16.0.0/12
# IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
# IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
# "--cluster-cidr=172.16.0.0/16,fdfd:cafe:00:0001::/64"
# "--service-cidr=172.17.0.0/16,fdfd:cafe:00:8001::/112"
];
nodeLabels = [
"node-purpose=kubevirt"
];
# flannel is disabled; Cilium provides the pod network.
};
in
{
imports = (mylib.scanPaths ./.) ++ [
@@ -48,7 +21,6 @@ in
../kubevirt-shoryu/hardware-configuration.nix
../kubevirt-shoryu/preservation.nix
coreModule
k3sModule
];
modules.btrbk.enable = true;
+1 -29
View File
@@ -9,37 +9,10 @@
let
hostName = "kubevirt-youko"; # Define your hostname.
coreModule = mylib.genKubeVirtHostModule {
coreModule = mylib.genVmHostModule {
inherit pkgs hostName;
inherit (myvars) networking;
};
k3sModule = mylib.genK3sServerModule {
inherit pkgs;
kubeconfigFile = "/home/${myvars.username}/.kube/config";
tokenFile = "/persistent/kubevirt-k3s-token";
# use my own domain & kube-vip's virtual IP for the API server
# so that the API server can always be accessed even if some nodes are down
masterHost = "kubevirt-cluster-1.writefor.fun";
kubeletExtraArgs = [
"--cpu-manager-policy=static"
# https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/
# we have to reserve some resources for for system daemons running as pods or system services
# when cpu-manager's static policy is enabled
# the memory we reserved here is also for the kernel, since kernel's memory is not accounted in pods
"--system-reserved=cpu=1,memory=2Gi,ephemeral-storage=2Gi"
];
k3sExtraArgs = [
# IPv4 Private CIDR(full) - 172.16.0.0/12
# IPv4 Pod CIDR(full) - fdfd:cafe:00:0000::/64 ~ fdfd:cafe:00:7fff::/64
# IPv4 Service CIDR(full) - fdfd:cafe:00:8000::/64 ~ fdfd:cafe:00:ffff::/64
# "--cluster-cidr=172.16.0.0/16,fdfd:cafe:00:0001::/64"
# "--service-cidr=172.17.0.0/16,fdfd:cafe:00:8001::/112"
];
nodeLabels = [
"node-purpose=kubevirt"
];
# flannel is disabled; Cilium provides the pod network.
};
in
{
imports = (mylib.scanPaths ./.) ++ [
@@ -48,7 +21,6 @@ in
../kubevirt-shoryu/hardware-configuration.nix
../kubevirt-shoryu/preservation.nix
coreModule
k3sModule
];
modules.btrbk.enable = true;