deploy: move the metrics and log store toggles
Same move as grafana, and the three belong together: they derive from one switch and a store with no UI is as useless as a UI with no store. `victorialogs` is the case that shows why the option-path sweep is not enough on its own. It has **zero** references spelled `swarm.victorialogs.enable` anywhere in the tree, and four spelled through `let` aliases (`vlCfg.enable` in the collector, `cfg.enable` in its own module). A sweep for the path would have reported nothing to do and left every reader broken. Prose moved with the code rather than being left behind: the comments in swarm-required-services.nix that explained why the pair derives together now sit above the assignments that do it, instead of above the gap where they used to be.
This commit is contained in:
parent
cf1f2f99cf
commit
29647f963e
9 changed files with 77 additions and 61 deletions
|
|
@ -34,6 +34,14 @@
|
|||
[ "services" "hyperhive" "swarm" "grafana" "enable" ]
|
||||
[ "services" "hyperhive" "deploy" "grafana" ]
|
||||
)
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "hyperhive" "swarm" "victoriametrics" "enable" ]
|
||||
[ "services" "hyperhive" "deploy" "victoriametrics" ]
|
||||
)
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "hyperhive" "swarm" "victorialogs" "enable" ]
|
||||
[ "services" "hyperhive" "deploy" "victorialogs" ]
|
||||
)
|
||||
];
|
||||
|
||||
options.services.hyperhive.deploy = {
|
||||
|
|
@ -49,5 +57,33 @@
|
|||
whether hyperhive is installed.
|
||||
'';
|
||||
};
|
||||
|
||||
victoriametrics = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Run the swarm's metrics store on this host.
|
||||
|
||||
Derives from
|
||||
{option}`services.hyperhive.swarm.enableRequiredServices` together
|
||||
with {option}`services.hyperhive.deploy.grafana`: a store with no
|
||||
UI is unreadable and a UI with no store is empty, so there is no
|
||||
sensible deployment that takes one and not the other from that
|
||||
switch. Set either directly to run exactly one.
|
||||
'';
|
||||
};
|
||||
|
||||
victorialogs = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Run the swarm's log store on this host.
|
||||
|
||||
Derives from
|
||||
{option}`services.hyperhive.swarm.enableRequiredServices` for the
|
||||
same reason as the metrics pair above: a hive that is not the
|
||||
service host is a *client* of this store, not a second one.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue