Repository navigation
fix(gateway): pass server and metrics ports to container - #279
Conversation
|
@claude can you resolve the merge conflict? |
|
Claude finished @edenreich's task in 3m 58s —— View job Merge conflict resolved
The only conflict was in
|
## [0.27.1](v0.27.0...v0.27.1) (2026-10-04) ### ♻️ Improvements * bump go toolchain to 1.26.8 ([#282](#282)) ([949858a](949858a)) ### 🐛 Bug Fixes * **gateway:** pass server and metrics ports to container ([#279](#279)) ([d3e3915](d3e3915)) * **gateway:** skip providers without an env block ([#278](#278)) ([b069167](b069167)) ### 📚 Documentation * **agents:** add code readability guidelines ([#275](#275)) ([6b6a444](6b6a444)) * correct gateway auth and tracing claims ([#276](#276)) ([9f79f76](9f79f76)) * fix gateway label selector and orchestrator snippets ([#280](#280)) ([bb93ed2](bb93ed2)) * **readme:** document gateway spec.a2a support ([#277](#277)) ([aad725c](aad725c))
|
🎉 This PR is included in version 0.27.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
spec.server.*andspec.telemetry.metrics.portshaped the Deployment ports, probes, Service and HTTPRoute but were never passed to the gateway process, so a non-default port left it listening on8080/9464while Kubernetes probed and routed to the configured port.buildContainernow emits the env vars the gateway actually reads (verified againstServerConfig/TelemetryConfigininference-gateway/inference-gatewayconfig/config.go):SERVER_PORTfromspec.server.port(default8080) - always emitted.SERVER_HOSTfromspec.server.host(default0.0.0.0) - the gateway's own default is loopback, which kubelet probes cannot reach.TELEMETRY_METRICS_PORTfromspec.telemetry.metrics.port(default9464) when telemetry and metrics are enabled.SERVER_TLS_CERT_PATH/SERVER_TLS_KEY_PATHwhenspec.server.tls.enabled.spec.server.tls.certificateRef/keyRefare now honoured instead of ignored: each reference is mounted from its own Secret (/app/tls/cert/<key>,/app/tls/key/<key>) and the path env vars point at it. With no references set the behaviour is unchanged - the conventionalinference-gateway-tlsSecret at/app/tlswithtls.crt/tls.key.Also fixed along the way:
buildContainerPortsreturned early whenspec.serverwas nil, so a Gateway with metrics enabled but no server block got nometricscontainer port even though the Service exposed one. Port and metrics-port resolution now lives in single helpers (gatewayServerPort,gatewayMetricsPort,metricsEnabled) shared by the container, the container ports and the Service, replacing three copies of the same default logic.No CRD or API change, so no regenerated manifests.
Testing
task test- 176 specs pass (7 new specs covering port/host/metrics env, TLS paths with and without refs, and the disabled cases).task fmt,task vet,task lint- clean.Downstream impact
None outside this repo: the env var names already exist in the gateway, no new configuration surface is added. Users who relied on the undocumented hardcoded
inference-gateway-tlsSecret are unaffected - that path is the fallback whencertificateRef/keyRefare unset.Closes #271