mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-19 14:18:17 +01:00
refactor: rename the three VM hosts to 12kingdoms-*
Drop the now-meaningless kubevirt- prefix and move the hosts out of hosts/k8s/, following the existing 12kingdoms-shoukei layout: the directory and output carry the theme prefix while the configuration, hostname and colmena target are the bare name (shoryu, shushou, youko). - hosts/k8s/kubevirt-* -> hosts/12kingdoms-*; the shared disko config becomes host-disko-fs.nix; the now-different relative imports are fixed - outputs, vars/networking.nix keys, the Justfile recipes/tags, the eval tests and the docs follow - colmena reaches these hosts by IP (a new targetHost override), since their DNS name changes with the hostname and is not resolvable until the router learns it
This commit is contained in:
1 parent
3aec8341dd
commit
2c7629000f
103 files changed
+78
-54
No files matched your search
@@ -8,7 +8,7 @@
|
||||
}:
|
||||
let
|
||||
# MoreFine - S500Plus
|
||||
hostName = "kubevirt-shoryu"; # Define your hostname.
|
||||
hostName = "shoryu"; # Define your hostname.
|
||||
|
||||
coreModule = mylib.genVmHostModule {
|
||||
inherit pkgs hostName;
|
||||
@@ -18,7 +18,7 @@ in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
disko.nixosModules.default
|
||||
../disko-config/kubevirt-disko-fs.nix
|
||||
../k8s/disko-config/host-disko-fs.nix
|
||||
./hardware-configuration.nix
|
||||
./preservation.nix
|
||||
coreModule
|
||||
File renamed without changes.
File renamed without changes.
@@ -21,7 +21,7 @@
|
||||
mysecrets
|
||||
;
|
||||
};
|
||||
config.imports = [ ../k3s-test-1-master-1 ];
|
||||
config.imports = [ ../k8s/k3s-test-1-master-1 ];
|
||||
};
|
||||
|
||||
# Attach the guest's tap to the VM bridge, the same way the physical NIC is
|
||||
File renamed without changes.
@@ -7,7 +7,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "kubevirt-shushou"; # Define your hostname.
|
||||
hostName = "shushou"; # Define your hostname.
|
||||
|
||||
coreModule = mylib.genVmHostModule {
|
||||
inherit pkgs hostName;
|
||||
@@ -17,9 +17,9 @@ in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
disko.nixosModules.default
|
||||
../disko-config/kubevirt-disko-fs.nix
|
||||
../kubevirt-shoryu/hardware-configuration.nix
|
||||
../kubevirt-shoryu/preservation.nix
|
||||
../k8s/disko-config/host-disko-fs.nix
|
||||
../12kingdoms-shoryu/hardware-configuration.nix
|
||||
../12kingdoms-shoryu/preservation.nix
|
||||
coreModule
|
||||
];
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
mysecrets
|
||||
;
|
||||
};
|
||||
config.imports = [ ../k3s-test-1-master-3 ];
|
||||
config.imports = [ ../k8s/k3s-test-1-master-3 ];
|
||||
};
|
||||
|
||||
# Attach the guest's tap to the VM bridge, the same way the physical NIC is
|
||||
@@ -1,6 +1,6 @@
|
||||
{ myvars, ... }:
|
||||
let
|
||||
hostAddress = myvars.networking.hostsAddr.kubevirt-shushou.ipv4;
|
||||
hostAddress = myvars.networking.hostsAddr.shushou.ipv4;
|
||||
in
|
||||
{
|
||||
power.ups = {
|
||||
@@ -7,7 +7,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hostName = "kubevirt-youko"; # Define your hostname.
|
||||
hostName = "youko"; # Define your hostname.
|
||||
|
||||
coreModule = mylib.genVmHostModule {
|
||||
inherit pkgs hostName;
|
||||
@@ -17,9 +17,9 @@ in
|
||||
{
|
||||
imports = (mylib.scanPaths ./.) ++ [
|
||||
disko.nixosModules.default
|
||||
../disko-config/kubevirt-disko-fs.nix
|
||||
../kubevirt-shoryu/hardware-configuration.nix
|
||||
../kubevirt-shoryu/preservation.nix
|
||||
../k8s/disko-config/host-disko-fs.nix
|
||||
../12kingdoms-shoryu/hardware-configuration.nix
|
||||
../12kingdoms-shoryu/preservation.nix
|
||||
coreModule
|
||||
];
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,7 +1,7 @@
|
||||
# Auto disk partitioning (from repo root: nix-config):
|
||||
# nix run github:nix-community/disko -- --mode destroy,format,mount hosts/k8s/kubevirt-youko/homelab-services/disko-fs.nix
|
||||
# nix run github:nix-community/disko -- --mode destroy,format,mount hosts/12kingdoms-youko/homelab-services/disko-fs.nix
|
||||
# Mount only (after first format):
|
||||
# nix run github:nix-community/disko -- --mode mount hosts/k8s/kubevirt-youko/homelab-services/disko-fs.nix
|
||||
# nix run github:nix-community/disko -- --mode mount hosts/12kingdoms-youko/homelab-services/disko-fs.nix
|
||||
let
|
||||
cryptKeyFile = "/etc/agenix/hdd-luks-crypt-key";
|
||||
unlockDisk = "data-encrypted";
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -101,10 +101,10 @@ in
|
||||
params.ups = [ "homelab" ];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "${myvars.networking.hostsAddr.kubevirt-shushou.ipv4}:9199" ];
|
||||
targets = [ "${myvars.networking.hostsAddr.shushou.ipv4}:9199" ];
|
||||
labels.type = "app";
|
||||
labels.app = "nut";
|
||||
labels.host = "kubevirt-shushou";
|
||||
labels.host = "shushou";
|
||||
labels.env = "homelab";
|
||||
labels.cluster = "homelab";
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-3
@@ -44,9 +44,9 @@ in
|
||||
backupPrepareCommand = ''
|
||||
${pkgs.nushell}/bin/nu -c '
|
||||
let kubevirt_nodes = [
|
||||
"kubevirt-shoryu"
|
||||
"kubevirt-shushou"
|
||||
"kubevirt-youko"
|
||||
"shoryu"
|
||||
"shushou"
|
||||
"youko"
|
||||
]
|
||||
|
||||
kubevirt_nodes | each {|it|
|
||||
File renamed without changes.
File renamed without changes.
@@ -21,7 +21,7 @@
|
||||
mysecrets
|
||||
;
|
||||
};
|
||||
config.imports = [ ../k3s-test-1-master-2 ];
|
||||
config.imports = [ ../k8s/k3s-test-1-master-2 ];
|
||||
};
|
||||
|
||||
# Attach the guest's tap to the VM bridge, the same way the physical NIC is
|
||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -104,13 +104,13 @@ Use existing hosts as templates. The key files typically include:
|
||||
### Examples to Reference
|
||||
|
||||
- **Desktop systems**: See `idols-ai/` for gaming/workstation setup
|
||||
- **Server systems**: See `kubevirt-shoryu/` for K8s/KubeVirt hosts
|
||||
- **Server systems**: See `shoryu/` for K8s/KubeVirt hosts
|
||||
- **macOS systems**: See `darwin-fern/` for macOS configurations
|
||||
- **Apple Silicon**: See `12kingdoms-shoukei/` for ARM Linux setup
|
||||
|
||||
## Deploying KubeVirt Hosts
|
||||
|
||||
The three KubeVirt hosts (`kubevirt-shoryu`, `kubevirt-shushou`, `kubevirt-youko`) put their VMs'
|
||||
The three KubeVirt hosts (`shoryu`, `shushou`, `youko`) put their VMs'
|
||||
secondary network on the Linux bridge `br0` (attached by the `bridge` CNI plugin); the pod network
|
||||
is Cilium (flannel disabled).
|
||||
|
||||
|
||||
+2
-2
@@ -39,11 +39,11 @@ keeps its identity and etcd membership instead of bootstraping a new cluster.
|
||||
|
||||
## TODO / Known issues
|
||||
|
||||
- **Retire KubeVirt.** aquamarine now runs natively on `kubevirt-youko`, and the k3s-test masters
|
||||
- **Retire KubeVirt.** aquamarine now runs natively on `youko`, and the k3s-test masters
|
||||
run as microVMs. Remove KubeVirt/CDI/multus from the cluster (k8s-gitops) once nothing else needs
|
||||
them, and the Windows VM is the only KubeVirt VM left to move.
|
||||
- **The USB HDD bridge is flaky.** aquamarine's two HDDs sit behind a JMicron JMS567 USB-SATA bridge
|
||||
that keeps resetting (`dmesg` on `kubevirt-youko`). Find out how often it resets and how much it
|
||||
that keeps resetting (`dmesg` on `youko`). Find out how often it resets and how much it
|
||||
matters before putting anything critical (e.g. an NFS export) on it.
|
||||
|
||||
## Kubernetes Resources
|
||||
|
||||
@@ -17,7 +17,7 @@ sudo nix --experimental-features "nix-command flakes" run github:nix-community/d
|
||||
systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 /dev/<encrypted-disk-part-path>
|
||||
|
||||
## 3. install nixos
|
||||
sudo nixos-install --root /mnt --no-root-password --show-trace --verbose --flake .#kubevirt-shoryu
|
||||
sudo nixos-install --root /mnt --no-root-password --show-trace --verbose --flake .#shoryu
|
||||
|
||||
# enter into the installed system, check password & users
|
||||
# `su ryan` => `sudo -i` => enter ryan's password => successfully login
|
||||
|
||||
File renamed without changes.
Reference in new issue
Block a user