Watch
0
0
Fork
You've already forked hyperhive
0

bind health listeners to the pod's loopback and probe them by exec

This commit is contained in:
atlas 2026-11-27 23:45:00 +01:00
commit 62cc95671d

View file

@ -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)