Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/host-modules/lib/fresh-state-option.nix

20 lines
909 B
Nix

# The `k8s.freshState` option of a service whose pod keeps state in a volume.
# `name` is the service's key under `services.hyperhive.deploy`. ../k8s/render.nix
# reads it into the pod's state gate.
{ lib }:
name:
lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = ''
With {option}`services.hyperhive.deploy.${name}.runtime` set to `k8s`: let
the pod start on an empty state volume. Off, the pod's first init container
stops it before the service starts and says so, until the volume holds
the `.hyperhive-migrated` marker that `swarmctl migrate` writes after it
copies the host's state in. On, an empty volume gets the marker at once
and the service starts with no state. Set it on a fresh install, which
has no state to lose. A volume that holds files and no marker is refused
either way, since a copy may have been cut off.
'';
}