Repository navigation
feat(teleport): link session Orchestrators to the workspace Gateway by ref - #1670
Merged
Merged
Conversation
…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.
Contributor
|
🎉 This PR is included in version 0.240.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A
standardKubernetes workspace now links every session Orchestrator to its Gateway withspec.gateway.refinstead of aspec.gateway.urlwith a hard-coded port. The operator derives the daemon'sINFER_GATEWAY_URLfrom 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.goorchestratorGatewayreturns{ref: <workspace gateway>}instandardmode withgateway_env, and{url: http://127.0.0.1:8080}inall-in-onemode, unchanged.gatewayURL,gatewayPortand the ponytail note about idle gateway cost are gone.server.port. The operator's default (8080) applies, and it addresses the Service on that port.internal/agent/infrastructure/kubernetes/workspace.goreachwaits 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'sReadyfor it.minOperatorVersionisv0.29.0. Strict field validation makes an older operator refusespec.gateway.ref, and the error now says the operator may predate that version.docs/daemon.md(operator requirement and parking), the session-teleport README's cloud section, and the example'sOPERATOR_VERSION.Out of scope
spec.gateway.urlkeep 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 chatin the example setsINFER_AGENT_MODEL=mock/openai/gpt-4o, so reattaching ak8s-cloudsession with it fails withmodel ... not available. This predates the change. SetINFER_AGENT_MODELto the workspace's model to chat there.Test plan
go test -raceforinternal/agent/...,internal/sessions/...andcmd/daemon/...TestReachWaitsForAParkedGatewayfails (nil TLS provider panic after skipping the wait) with the oldcreate &&guard and passes with the changetask precommit:runinfer-workspaceswith operator v0.29.0: teleport tok8s-cloud. The Orchestrator hasspec.gateway: {ref: infer-gateway-ad2f918bfc2f}, and the pod'sINFER_GATEWAY_URLishttp://infer-gateway-ad2f918bfc2f.infer-workspaces.svc.cluster.local:8080with no provider key in its envoperatingMode: Suspendedchange the operator makes once the pod idles out) scales the gateway Deployment to0/0with no pod. The Gateway and its credentials Secret stayinfer chat --daemon --session-idresumes the Orchestrator, the gateway comes back to1/1, and a turn onollama_cloud/glm-5.3-flashanswers from the pod through it