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

@ -799,12 +799,13 @@ pkgs.testers.runNixOSTest {
machine.wait_until_fails(dials(other, ip, METRICS), timeout=120)
for _ in range(3):
assert machine.execute(dials(other, ip, METRICS))[0] != 0
# The responder's health port answers the node with a status and is
# closed to the same two sources: the namespace's default admits the
# The responder's health port answers inside the pod only and is
# closed to the node and to the same two sources: the namespace's default admits the
# node and nobody else, and the pod's own policy names the client port
# only.
code = machine.succeed(f"curl -s -o /dev/null -w '%{{http_code}}' --max-time 5 http://{pod_ip}:8080/healthz").strip()
code = machine.succeed(f"nsenter --target {pod_pid(SERVICE)} --net -- curl -s -o /dev/null -w '%{{http_code}}' --max-time 5 http://127.0.0.1:8080/healthz").strip()
assert code == "200", code
assert machine.execute(f"curl -s -o /dev/null --max-time 5 http://{pod_ip}:8080/healthz")[0] == 7
machine.wait_until_fails(dials(other, pod_ip, 8080), timeout=120)
for port in (8080, METRICS):
assert machine.execute(dials(other, pod_ip, port))[0] != 0, port