bind health listeners to the pod's loopback and probe them by exec
This commit is contained in:
parent
b7a8410769
commit
62cc95671d
1 changed files with 255 additions and 185 deletions
|
|
@ -774,7 +774,11 @@ let
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (import ../images { inherit pkgs lib; }) mkServiceImage;
|
||||
inherit (import ../images { inherit pkgs lib; })
|
||||
mkServiceImage
|
||||
wgetOnly
|
||||
loopbackProbe
|
||||
;
|
||||
podAuth = import ./lib/bao-pod-auth.nix;
|
||||
|
||||
tools = [
|
||||
|
|
@ -870,10 +874,7 @@ let
|
|||
bin = "nats-server";
|
||||
extraContents = [
|
||||
(pkgs.writeTextDir "share/hyperhive/${machine}-settings.refs" "${renderedSettings}\n")
|
||||
(pkgs.runCommand "wget-only" { } ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${pkgs.pkgsStatic.busybox}/bin/busybox $out/bin/wget
|
||||
'')
|
||||
wgetOnly
|
||||
];
|
||||
};
|
||||
exporter = mkServiceImage {
|
||||
|
|
@ -972,17 +973,7 @@ let
|
|||
# The monitor is on the pod's loopback, so the probe runs in the
|
||||
# container. A server that has not opened its JetStream store is not
|
||||
# ready.
|
||||
readinessProbe = {
|
||||
exec.command = [
|
||||
"/bin/wget"
|
||||
"-q"
|
||||
"-O"
|
||||
"/dev/null"
|
||||
"http://127.0.0.1:${toString deployCfg.nats.monitorPort}/healthz?js-enabled-only=true"
|
||||
];
|
||||
periodSeconds = 10;
|
||||
timeoutSeconds = 5;
|
||||
};
|
||||
readinessProbe = loopbackProbe deployCfg.nats.monitorPort "/healthz?js-enabled-only=true";
|
||||
volumeMounts = [
|
||||
(volumeNamed "nats-tls" tlsDir true)
|
||||
(volumeNamed "nats-config" runtimeDir true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue