Skip to content

[FEATURE] Scale a Gateway to zero while every Orchestrator using it is suspended #305

Description

@edenreich

Summary

Scale a Gateway to zero while every Orchestrator that uses it is suspended, and back up when one resumes.

The infer CLI now deploys one Gateway per Kubernetes workspace beside the workspace's sessions. Each session's
runtime: Sandbox Orchestrator owns it, so the Gateway goes with the last session. When the sessions idle out, the
operator suspends their Orchestrators and the pods go, but the Gateway keeps a pod running until the last retention runs
out, a day by default in the session-teleport example. The CLI cannot scale it: it is not running when the operator
suspends, and the Sandbox pods have no Kubernetes API access.

A suggested shape: Orchestrator.spec.gateway.ref names a Gateway in the same namespace. The operator then derives
INFER_GATEWAY_URL from that Gateway's Service, so clients stop hard-coding its port. It also runs the Gateway with
spec.replicas while any referencing Orchestrator runs and with zero while all of them are suspended. Using the
Gateway's Orchestrator owner references instead would work without an API change.

Acceptance Criteria

  • A Gateway whose Orchestrators are all suspended has no running pod, and its Deployment and Secret stay.
  • Resuming one of them (spec.sandbox.operatingMode: Running) scales the Gateway back up before the
    Orchestrator reports Ready, so the daemon's first call reaches it.
  • A Gateway no Orchestrator references keeps its spec.replicas and HPA behavior unchanged.
  • The Orchestrator docs and samples cover the Gateway link and the scaling.

Activity

  1. added
    enhancement
    on Oct 31, 2026
  2. moved this to Todo in 2026on Oct 31, 2026
  3. edenreich commented on Oct 31, 2026

    @edenreich
    ContributorAuthor

    @claude can you work on this? use /ponytail:ponytail /domain-driven-design /clean-architecture

  4. inference-gateway-maintainer commented on Oct 31, 2026

    @inference-gateway-maintainer
    Contributor

    Claude finished @edenreich's task in 12m 54s —— View job • feat/issue-305-20261031-1958 • [Create PR ➔](https://github.com/inference-gateway/operator/compare/main...feat/issue-305-20261031-1958?quick_pull=1&title=Issue%20%23305%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23305%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Scale a Gateway to zero while every Orchestrator using it is suspended

    Shape

    spec.gateway.ref instead of the ownerReference variant: it is declarative, and it does not tie the Gateway's lifetime to one session. The replica rule lives in one place now - the Deployment update path follows the count the builder computed (parked / HPA / spec.replicas) instead of recomputing it from the spec.

    Not done / risk: the resume ordering is concurrent, not sequenced. The scale-up is enqueued by the same event that resumes the Sandbox, but the Orchestrator's Ready is not held back until the Gateway has an available replica, so a daemon calling the gateway in its very first instant could still race a cold pod. Gating readiness on the linked Gateway's status.availableReplicas is a small follow-up if you want it. No new Gateway status field explaining why it is parked.
    • branch • PR #307

  5. moved this from Todo to In progress in 2026on Oct 31, 2026
  6. moved this from In progress to QA in 2026on Oct 31, 2026
  7. moved this from QA to Done in 2026on Oct 31, 2026
  8. inference-gateway-releaser commented on Oct 31, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.29.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions