mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 05:13:04 +00:00
e96e5ddd1f
KubeVirt[1] allows for VMs to be run and managed as pods inside of Kubernetes clusters. Information about the guests can be exposed through qemu-guest-agent[2] as well as startup scripts can be injected through cloud-init[3]. This config has been duplicated and modified from the `cloudstack` config/script. To test this out, deploy KubeVirt locally with KinD[4], build the disk image, then package it into a container image (or upload to CDI[5]) and provision a VirtualMachine. [1]: https://kubevirt.io/user-guide/ [2]: https://kubevirt.io/user-guide/virtual_machines/guest_agent_information/ [3]: https://kubevirt.io/user-guide/virtual_machines/startup_scripts/#cloud-init-examples [4]: https://kubevirt.io/quickstart_kind/ [5]: https://kubevirt.io/user-guide/operations/containerized_data_importer/#containerized-data-importer Signed-off-by: jbpratt <jbpratt78@gmail.com>
31 lines
678 B
Nix
31 lines
678 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
../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;
|
|
|
|
system.build.kubevirtImage = import ../../lib/make-disk-image.nix {
|
|
inherit lib config pkgs;
|
|
format = "qcow2";
|
|
};
|
|
};
|
|
}
|