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