Skip to content

fix(gateway): probe over HTTPS when spec.server.tls is on - #312

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-310-20261101-1240
Nov 1, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-310-20261101-1240

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

A Gateway with spec.server.tls.enabled never became Ready: the controller left the liveness and readiness probes at scheme: HTTP while the gateway serves TLS on SERVER_PORT, so every probe got HTTP 400 and the liveness probe restarted the container. The root cause of the rest of the report is the same hard-coded 8443 assumption in three places.

Changes, all in internal/controller/gateway_controller.go:

  • New healthProbe(gateway) builds both probes and sets Scheme: HTTPS when spec.server.tls.enabled is set. Both probes were identical literals, so this also removes the duplication.
  • buildContainerPorts no longer appends a hard-coded 8443/https container port. The container declares exactly one server port, spec.server.port, named https when TLS is on and http otherwise (new serverPortName helper).
  • desiredService drops the phantom hard-coded 8443 Service port, names the main port after the scheme, and targets the container port by name - so a spec.service.port that differs from spec.server.port now routes to the right container port instead of to its own number.
  • gatewayServicePort no longer falls back to 8443 when TLS is on with no explicit port: the gateway serves TLS on the default 8080 in that case, so the Service and status.url now point at the port the process actually listens on.

Tests

Three specs added to internal/controller/gateway_controller_test.go: HTTPS probes plus the single https container port under TLS, HTTP probes with no 8443 port when TLS is off, and the Service port/name/targetPort under TLS with no explicit port.

task test (237 specs, envtest), task lint (0 issues), task fmt, task vet all pass. No API types changed, so no manifest or deepcopy regeneration.

Behavior change to note

Under TLS, the Gateway Service port is renamed http -> https and the extra 8443 port disappears. Anything selecting the Service port by the name http under TLS must switch to https. status.url keeps the same shape.

Closes #310

@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner November 1, 2026 12:47
@edenreich
edenreich merged commit 2e3400c into main Nov 1, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-310-20261101-1240 branch November 1, 2026 13:05
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 1, 2026
## [0.31.0](v0.30.0...v0.31.0) (2026-11-01)

### ✨ Features

* **gateway:** express mutual TLS in both directions ([#313](#313)) ([3cd4b24](3cd4b24)), closes [#311](#311)
* **gateway:** validate mutual TLS field combinations ([#315](#315)) ([d43a7ea](d43a7ea))

### 🐛 Bug Fixes

* **gateway:** probe over HTTPS when spec.server.tls is on ([#312](#312)) ([2e3400c](2e3400c))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.31.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Gateway with spec.server.tls never becomes Ready: probes stay HTTP on the TLS port

1 participant