feat: add a test k3s cluster running on kubevirt

This commit is contained in:
Ryan Yin
2024-03-23 02:05:54 +08:00
parent c258b3b1c8
commit 2319300f48
13 changed files with 338 additions and 26 deletions

View File

@@ -0,0 +1,34 @@
{modulesPath, ...}:
##############################################################################
#
# Template for KubeVirt's VM, mainly based on:
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/kubevirt.nix
#
# We write our hardware-configuration.nix, so that we can do some customization more easily.
#
# the url above is used by `nixos-generator` to generate the KubeVirt's qcow2 image file.
#
##############################################################################
{
imports = [
"${toString modulesPath}/profiles/qemu-guest.nix"
];
config = {
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
boot.growPartition = true;
boot.kernelParams = [ "console=ttyS0" ];
boot.loader.grub.device = "/dev/vda";
boot.loader.timeout = 0;
services.qemuGuest.enable = true;
services.openssh.enable = true;
services.cloud-init.enable = true;
systemd.services."serial-getty@ttyS0".enable = true;
};
}