create shadow docker swarm

This commit is contained in:
Pim Kunis 2024-02-06 22:03:25 +01:00
parent 701cc85327
commit ab8ae06040
3 changed files with 50 additions and 13 deletions

View file

@ -58,6 +58,7 @@
};
};
# TODO: make leases persistent!
hermes = {
type = "virtual";
hypervisorName = "lewis";
@ -79,7 +80,7 @@
maestro2 = {
type = "virtual";
hypervisorName = "lewis";
hypervisorName = "atlas";
nixosModule = { pkgs, lib, config, ... }: {
lab.vm = {
@ -90,7 +91,7 @@
};
microvm.shares = [{
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker_swarm";
source = "/data/vm_shares/${config.networking.hostName}/docker_swarm";
mountPoint = "/var/lib/docker/swarm";
tag = "docker_swarm";
proto = "virtiofs";
@ -118,13 +119,47 @@
bancomart2 = {
type = "virtual";
hypervisorName = "lewis";
hypervisorName = "jefke";
nixosModule = { pkgs, lib, config, ... }: {
lab.vm.id = 2;
microvm.shares = [{
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker_swarm";
source = "/data/vm_shares/${config.networking.hostName}/docker_swarm";
mountPoint = "/var/lib/docker/swarm";
tag = "docker_swarm";
proto = "virtiofs";
socket = "docker_swarm.sock";
}];
networking = {
nftables.enable = lib.mkForce false;
firewall.enable = lib.mkForce false;
};
virtualisation.docker = {
enable = true;
liveRestore = false;
};
environment.systemPackages = with pkgs; [
(python311.withPackages (python-pkgs: [
python-pkgs.docker
python-pkgs.requests
]))
];
};
};
vpay2 = {
type = "virtual";
hypervisorName = "lewis";
nixosModule = { pkgs, lib, config, ... }: {
lab.vm.id = 3;
microvm.shares = [{
source = "/data/vm_shares/${config.networking.hostName}/docker_swarm";
mountPoint = "/var/lib/docker/swarm";
tag = "docker_swarm";
proto = "virtiofs";