Skip to content

[FEATURE] Expose gateway round-robin model routing (ROUTING_ENABLED / ROUTING_CONFIG_PATH) #175

Description

@edenreich

Summary

The gateway now supports opt-in round-robin model routing over upstream pools (Phase 1 of #397), shipped in gateway v0.39.0 via PR inference-gateway/inference-gateway#490. The docs for it are already in place (docs issue #464). The operator does not yet expose this feature, so users running the gateway through the operator cannot enable routing declaratively.

Routing is driven by two env vars on the gateway:

  • ROUTING_ENABLED - boolean toggle (default: off).
  • ROUTING_CONFIG_PATH - path to a YAML file describing model-alias -> ordered provider/model pools.

The operator needs to surface both, and provide a way to supply the routing config YAML (mounted at ROUTING_CONFIG_PATH).

Proposed approach

  • Add a routing section to the Gateway CRD spec:
    • routing.enabled -> ROUTING_ENABLED.
    • routing.config (inline YAML) or routing.configMapRef -> rendered/mounted at ROUTING_CONFIG_PATH, with ROUTING_CONFIG_PATH set accordingly.
  • Reconcile the config into a ConfigMap and mount it into the gateway pod when routing.enabled is true.
  • Update the Helm chart values and the generated CRD manifests to match.
  • Add example manifest(s) showing an alias mapping to a 2+ deployment pool.

Acceptance Criteria

  • Gateway CRD exposes routing.enabled and a way to supply the routing config; both map to ROUTING_ENABLED / ROUTING_CONFIG_PATH on the gateway container.
  • Routing config is delivered to the pod (ConfigMap mount) and ROUTING_CONFIG_PATH points at it.
  • Helm values + generated CRD/manifests updated; example manifest added.
  • Reconciler tests cover routing enabled/disabled paths.

References

Activity

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

    @edenreich
    ContributorAuthor

    @claude Can you implement this? use /go /go-concurrency /ponytail:ponytail

  4. inference-gateway-maintainer commented on Jul 22, 2026

    @inference-gateway-maintainer
    Contributor

    Claude finished @edenreich's task in 15m 34s —— View job • feat/issue-175-20260722-2109


    Implemented: round-robin model routing (ROUTING_ENABLED / ROUTING_CONFIG_PATH)

    • Explore Gateway CRD spec + reconciler
    • Add modelRouting section to Gateway CRD spec (enabled, config, configMapRef)
    • Wire ROUTING_ENABLED / ROUTING_CONFIG_PATH env + ConfigMap mount in reconciler
    • Regenerate CRDs / deepcopy / manifests
    • Add example manifest
    • Add reconciler tests (disabled / inline / configMapRef / cleanup)
    • task test (controller suite green, 63.4% cover) + task lint (0 issues)

    PR: #176

    Key decision

    The env vars are ROUTING_*, but spec.routing is already taken on this CRD for north-south Kubernetes Gateway API traffic - a different concept. To avoid conflating them, the new feature lives under spec.modelRouting:

    • modelRouting.enabled -> ROUTING_ENABLED
    • modelRouting.config (inline YAML) -> rendered into an operator-owned ConfigMap <gateway>-routing, mounted at /etc/inference-gateway/routing, with ROUTING_CONFIG_PATH pointed at the file
    • modelRouting.configMapRef -> mounts an existing ConfigMap key instead

    The reconciler creates/updates/deletes the ConfigMap (reconcileModelRoutingConfig), mounts it, sets the env vars, and now Owns ConfigMaps.

    Notes

    Create a PR · · branch feat/issue-175-20260722-2109

  5. added a commit that references this issue on Jul 22, 2026
    1ac4455
  6. inference-gateway-releaser commented on Jul 23, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.21.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  7. moved this from QA to Done in 2026on Jul 23, 2026
  8. added a commit that references this issue on Jul 23, 2026
    062f48a
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions