make docker swarm persistent using virtiofs share
This commit is contained in:
parent
17f110b183
commit
cf57391629
1 changed files with 18 additions and 2 deletions
|
@ -81,7 +81,7 @@
|
||||||
type = "virtual";
|
type = "virtual";
|
||||||
hypervisorName = "lewis";
|
hypervisorName = "lewis";
|
||||||
|
|
||||||
nixosModule = { pkgs, lib, ... }: {
|
nixosModule = { pkgs, lib, config, ... }: {
|
||||||
lab.vm = {
|
lab.vm = {
|
||||||
id = 1;
|
id = 1;
|
||||||
staticNetworking = true;
|
staticNetworking = true;
|
||||||
|
@ -89,6 +89,14 @@
|
||||||
staticIPv6 = "2a0d:6e00:1a77:30::42";
|
staticIPv6 = "2a0d:6e00:1a77:30::42";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
microvm.shares = [{
|
||||||
|
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker_swarm";
|
||||||
|
mountPoint = "/var/lib/docker/swarm";
|
||||||
|
tag = "docker_swarm";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "docker_swarm.sock";
|
||||||
|
}];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
nftables.enable = lib.mkForce false;
|
nftables.enable = lib.mkForce false;
|
||||||
firewall.enable = lib.mkForce false;
|
firewall.enable = lib.mkForce false;
|
||||||
|
@ -112,9 +120,17 @@
|
||||||
type = "virtual";
|
type = "virtual";
|
||||||
hypervisorName = "lewis";
|
hypervisorName = "lewis";
|
||||||
|
|
||||||
nixosModule = { pkgs, lib, ... }: {
|
nixosModule = { pkgs, lib, config, ... }: {
|
||||||
lab.vm.id = 2;
|
lab.vm.id = 2;
|
||||||
|
|
||||||
|
microvm.shares = [{
|
||||||
|
source = "/var/lib/microvms/${config.networking.hostName}/shares/docker_swarm";
|
||||||
|
mountPoint = "/var/lib/docker/swarm";
|
||||||
|
tag = "docker_swarm";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "docker_swarm.sock";
|
||||||
|
}];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
nftables.enable = lib.mkForce false;
|
nftables.enable = lib.mkForce false;
|
||||||
firewall.enable = lib.mkForce false;
|
firewall.enable = lib.mkForce false;
|
||||||
|
|
Loading…
Reference in a new issue