modules/cluster: start supporting multiple storages
This commit is contained in:
parent
27d2252d11
commit
ebf4e41b73
|
@ -44,6 +44,10 @@ in {
|
||||||
servers = servers;
|
servers = servers;
|
||||||
# run tasks only on these:
|
# run tasks only on these:
|
||||||
client.enable = builtins.elem hostName microvmServers;
|
client.enable = builtins.elem hostName microvmServers;
|
||||||
|
client.meta =
|
||||||
|
lib.optionalAttrs (builtins.elem hostName storageServers) {
|
||||||
|
"c3d2.storage" = "big";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
microvmUid = 997;
|
microvmUid = 997;
|
||||||
|
|
||||||
|
|
|
@ -18,5 +18,9 @@
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
default = [ "/etc" "/home" "/var" ];
|
default = [ "/etc" "/home" "/var" ];
|
||||||
};
|
};
|
||||||
|
storage = mkOption {
|
||||||
|
type = types.enum [ "fast" "big" ];
|
||||||
|
default = "fast";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ in
|
||||||
tag = builtins.replaceStrings [ "/" ] [ "-" ] (
|
tag = builtins.replaceStrings [ "/" ] [ "-" ] (
|
||||||
withoutLeadingSlash mountPoint
|
withoutLeadingSlash mountPoint
|
||||||
);
|
);
|
||||||
source = "/glusterfs/fast/microvms/${user}/${repo}/${vmName}/${withoutLeadingSlash mountPoint}";
|
source = "/glusterfs/${config.deployment.storage}/microvms/${user}/${repo}/${vmName}/${withoutLeadingSlash mountPoint}";
|
||||||
inherit mountPoint;
|
inherit mountPoint;
|
||||||
}) config.deployment.persistedShares;
|
}) config.deployment.persistedShares;
|
||||||
volumes = [ {
|
volumes = [ {
|
||||||
|
@ -76,6 +76,13 @@ in
|
||||||
}) config.deployment.networks;
|
}) config.deployment.networks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
skyflake = {
|
||||||
|
nomadJob.constraints = lib.optionals (config.deployment.storage == "big") [ {
|
||||||
|
attribute = "\${meta.c3d2.storage}";
|
||||||
|
value = "big";
|
||||||
|
} ];
|
||||||
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
dhcpcd.enable = false;
|
dhcpcd.enable = false;
|
||||||
|
|
Loading…
Reference in New Issue