Skip to content

feat(teleport): link session Orchestrators to the workspace Gateway by ref - #1670

Merged
edenreich merged 1 commit into
mainfrom
feat/teleport-gateway-ref
Oct 31, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/teleport-gateway-ref

Conversation

@edenreich

@edenreich edenreich commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A standard Kubernetes workspace now links every session Orchestrator to its Gateway with spec.gateway.ref instead of a spec.gateway.url with a hard-coded port. The operator derives the daemon's INFER_GATEWAY_URL from the Gateway's Service, and it runs the Gateway with no pod while every Orchestrator referencing it is suspended. An idle workspace now keeps no gateway pod, while its Gateway, Deployment and credentials Secret stay.

Requires operator v0.29.0 or later (inference-gateway/operator#307).

Closes #1669

Changes

  • internal/agent/infrastructure/kubernetes/gateway.go
    • orchestratorGateway returns {ref: <workspace gateway>} in standard mode with gateway_env, and {url: http://127.0.0.1:8080} in all-in-one mode, unchanged. gatewayURL, gatewayPort and the ponytail note about idle gateway cost are gone.
    • The Gateway spec no longer sets server.port. The operator's default (8080) applies, and it addresses the Service on that port.
  • internal/agent/infrastructure/kubernetes/workspace.go
    • reach waits for the workspace gateway on every reach, not only on create. A turn or a teleport home that resumes a parked session waits for the gateway, because the operator scales it up at the same time as the resume but does not hold the Orchestrator's Ready for it.
    • minOperatorVersion is v0.29.0. Strict field validation makes an older operator refuse spec.gateway.ref, and the error now says the operator may predate that version.
  • Docs: docs/daemon.md (operator requirement and parking), the session-teleport README's cloud section, and the example's OPERATOR_VERSION.

Out of scope

  • Orchestrators that rc.9 created with spec.gateway.url keep it. The operator does not count them as referencing the Gateway, so a mix of old and new sessions on one workspace could park the Gateway under a running old session. Stop those sessions or delete their Orchestrators by hand.
  • task chat in the example sets INFER_AGENT_MODEL=mock/openai/gpt-4o, so reattaching a k8s-cloud session with it fails with model ... not available. This predates the change. Set INFER_AGENT_MODEL to the workspace's model to chat there.

Test plan

  • go test -race for internal/agent/..., internal/sessions/... and cmd/daemon/...
  • TestReachWaitsForAParkedGateway fails (nil TLS provider panic after skipping the wait) with the old create && guard and passes with the change
  • task precommit:run
  • k3d infer-workspaces with operator v0.29.0: teleport to k8s-cloud. The Orchestrator has spec.gateway: {ref: infer-gateway-ad2f918bfc2f}, and the pod's INFER_GATEWAY_URL is http://infer-gateway-ad2f918bfc2f.infer-workspaces.svc.cluster.local:8080 with no provider key in its env
  • Suspending the session's Orchestrator (the same operatingMode: Suspended change the operator makes once the pod idles out) scales the gateway Deployment to 0/0 with no pod. The Gateway and its credentials Secret stay
  • Reattaching the session from infer chat --daemon --session-id resumes the Orchestrator, the gateway comes back to 1/1, and a turn on ollama_cloud/glm-5.3-flash answers from the pod through it

…y ref

A standard Kubernetes workspace now sets spec.gateway.ref to its Gateway on
every session Orchestrator instead of a spec.gateway.url with a hard-coded
port. The operator derives the daemon's gateway URL from the Gateway's
Service and runs the Gateway with no pod while every session is suspended.

Every reach now waits for the workspace gateway to serve, so a turn or a
teleport home that resumes a session also waits for its parked gateway to
come back. The Gateway spec no longer names a port and the operator's
default applies. The CLI now requires operator v0.29.0.
@edenreich
edenreich requested a review from a team as a code owner October 31, 2026 20:54
@github-project-automation github-project-automation Bot moved this to Todo in 2026 Oct 31, 2026
@edenreich
edenreich merged commit 8a9c63a into main Oct 31, 2026
1 check passed
@edenreich
edenreich deleted the feat/teleport-gateway-ref branch October 31, 2026 22:47
@edenreich edenreich moved this from Todo to Done in 2026 Nov 1, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.240.0 🎉

The release is available on:

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

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Deploy session Orchestrators with spec.gateway.ref so an idle workspace parks its Gateway

1 participant