Documentation
¶
Overview ¶
Command agent-ready is the aether-agent pod's exec liveness and readiness probe (proposal 041).
The agent pod is hostNetwork. A surge roll (agent.updateStrategy.surge) runs the new agent as a standby beside the old one on the same node, so no TCP port can serve the kubelet's probes: the surge pod's hostPort would collide (the scheduler keeps it Pending), the process could not bind it anyway, and a port shared with SO_REUSEPORT would let the OTHER agent answer for this one. So the agent serves /healthz and /readyz on a Unix socket in the pod's own /tmp emptyDir (--health-socket), and the kubelet execs this binary in the agent container to ask it.
It is exec'd every probe period, so it must be TINY — the proxy-ready pattern (#673): package init() runs before main() and cannot be skipped by any argv check, so the only way not to pay for a dependency is not to link it. It is stdlib-only and does not even link net/http: it writes one HTTP/1.0 request by hand and reads the status line. //agent/cmd/agent-ready:deps_test fails the build if anything else is linked.