You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(aigw): consolidate admin server into a single port (envoyproxy#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]>
Copy file name to clipboardExpand all lines: cmd/aigw/main.go
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,8 @@ type (
28
28
TranslatecmdTranslate`cmd:"" help:"Translate yaml files containing AI Gateway resources to Envoy Gateway and Kubernetes resources. The translated resources are written to stdout."`
29
29
// Run is the sub-command parsed by the `cmdRun` struct.
30
30
RuncmdRun`cmd:"" help:"Run the AI Gateway locally for given configuration."`
31
+
// Healthcheck is the sub-command to check if the aigw server is healthy.
// cmdTranslate corresponds to `aigw translate` command.
33
35
cmdTranslatestruct {
@@ -36,8 +38,13 @@ type (
36
38
}
37
39
// cmdRun corresponds to `aigw run` command.
38
40
cmdRunstruct {
39
-
Debugbool`help:"Enable debug logging emitted to stderr."`
40
-
Pathstring`arg:"" name:"path" optional:"" help:"Path to the AI Gateway configuration yaml file. Optional when at least OPENAI_API_KEY is set." type:"path"`
41
+
Debugbool`help:"Enable debug logging emitted to stderr."`
42
+
Pathstring`arg:"" name:"path" optional:"" help:"Path to the AI Gateway configuration yaml file. Optional when at least OPENAI_API_KEY is set." type:"path"`
43
+
AdminPortint`help:"HTTP port for the admin server (serves /metrics and /health endpoints)." default:"1064"`
44
+
}
45
+
// cmdHealthcheck corresponds to `aigw healthcheck` command.
46
+
cmdHealthcheckstruct {
47
+
AdminPortint`help:"HTTP port for the admin server (serves /metrics and /health endpoints)." default:"1064"`
0 commit comments