Skip to content

Commit 18bdc6d

Browse files
feat(aigw): consolidate admin server into a single port (#1236)
**Description** This consolidates the extproc admin server from two separate ports (metricsPort and healthPort) into a single adminPort (default 1064) serving both /metrics and /health endpoints. The `aigw run` and the new `aigw healthcheck` commands now take --admin-port flags, propagating this to extproc. Previously, extproc exposed metrics on port 1064 and health checks on port 1065. Now both are served from a single HTTP server on port 1064, simplifying configuration and Docker HEALTHCHECK setup. The Docker HEALTHCHECK is now functional, using the new healthcheck subcommand which polls the admin server's /health endpoint. This /health endpoint proxies to the extproc gRPC health check, returning HTTP 200 when SERVING. A new subcommand (`aigw healthcheck`) was needed as the image is distroless (has no curl etc). When aigw run starts Envoy, it polls for readiness using either the Envoy admin address (when configured in EnvoyProxy bootstrap) or by checking if the Gateway listener port accepts TCP connections. This ensures startup completes reliably with minimal Gateway configurations. Gateway validation now requires at least one listener to be configured. --------- Signed-off-by: Adrian Cole <[email protected]>
1 parent 39aefb1 commit 18bdc6d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/internal/e2elib/e2elib.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,3 +906,29 @@ func waitUntilKubectl(t *testing.T, timeout time.Duration, pollInterval time.Dur
906906
}
907907
require.Fail(t, "timed out waiting", "last error: %v", lastErr)
908908
}
909+
910+
// waitUntilKubectl polls by running a kubectl command with the given args
911+
// until the verifyOut predicate returns nil or the timeout is reached.
912+
//
913+
// Unlike require.Eventually, this retains the output of the last mismatch.
914+
func waitUntilKubectl(t *testing.T, timeout time.Duration, pollInterval time.Duration, verifyOut func(output string) error, args ...string) {
915+
var lastErr error
916+
deadline := time.Now().Add(timeout)
917+
for time.Now().Before(deadline) {
918+
cmd := Kubectl(t.Context(), args...)
919+
cmd.Stdout = nil // To ensure that we can capture the output by Output().
920+
out, err := cmd.Output()
921+
if err != nil {
922+
lastErr = err
923+
time.Sleep(pollInterval)
924+
continue
925+
}
926+
err = verifyOut(string(out))
927+
if err == nil {
928+
return
929+
}
930+
lastErr = err
931+
time.Sleep(pollInterval)
932+
}
933+
require.Fail(t, "timed out waiting", "last error: %v", lastErr)
934+
}

0 commit comments

Comments
 (0)