docker-stack: add deploy config

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-14 23:11:28 +03:00
parent c5bba581f5
commit 6f7bf47520
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
2 changed files with 29 additions and 0 deletions

View file

@ -80,6 +80,10 @@ in
"${mirrorVolume dynamicConfigFile}:ro" "${mirrorVolume dynamicConfigFile}:ro"
"${mirrorVolume config.age.secrets.traefik-dashboard-basicauth-users.path}:ro" "${mirrorVolume config.age.secrets.traefik-dashboard-basicauth-users.path}:ro"
]; ];
deploy = {
placement.constraints = [ "node.role==manager" ];
update_config.order = "start-first";
};
}; };
}; };

View file

@ -96,6 +96,31 @@ let
] ]
''; '';
}; };
deploy = {
placement = {
constraints = mkOption {
default = [ ];
type = types.listOf types.str;
description = lib.mdDoc "";
example = [ "node.role==manager" ];
};
};
update_config = {
order = mkOption {
default = "stop-first";
type = types.str;
description = lib.mdDoc ''
Order of operations during updates.
- stop-first (old task is stopped before starting new one),
- start-first (new task is started first, and the running tasks briefly overlap)
Note: Only supported for v3.4 and higher.
'';
example = "start-first";
};
};
};
}; };
}; };