You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Pod labels, annotations and scheduling for Gateway, Agent and MCP workloads #308
The workload CRDs give no way to shape the pods the operator creates. Gateway, Agent and MCP have no fields for pod labels, pod annotations, nodeSelector, tolerations or affinity. The only annotations in the API are Gateway.spec.service.annotations, which land on the Service, not the pods. A pod gets exactly the app: <name> label the controller sets, and nothing else can be added.
This blocks common integrations:
Sidecar injection keyed on pod labels or annotations, such as Istio (sidecar.istio.io/inject), Linkerd (linkerd.io/inject) or the NetBird Kubernetes operator's SidecarProfile.podSelector. NetBird works today only because the selector can reuse app: <name>. Anything that needs its own label or an annotation cannot opt in.
Scheduling: pinning a gateway to a node pool, tolerating a taint (for example a GPU or edge pool), or spreading replicas with affinity.
Found while building examples/kubernetes-session-teleport-netbird in inference-gateway/cli (inference-gateway/cli#1671). There, a Gateway is a NetBird peer through an injected sidecar, and its pod could not be pinned to a node like the other workloads in the example.
One new API type carries the whole feature: PodSpec in api/v1alpha1/pod_types.go with labels, annotations, nodeSelector, tolerations, affinity, plus an ApplyTo(*corev1.PodTemplateSpec) method. Each workload CRD gained Pod *PodSpec (spec.pod), and each builder calls ApplyTo on the template it just built - gateway_controller.go, agent_controller.go, mcp_controller.go, one line each.
Operator-owned labels and annotations win on a key conflict, so app: <name> can never be replaced and the Deployment selector plus Services keep working. All three controllers already replace the whole pod template on update, so changing a spec.pod field rolls the Deployment and removing one drops it - no extra code needed.
Tests live in internal/controller/pod_spec_test.go: a table over the Gateway/Agent/MCP builders asserting every field passes through and the app label survives a hijack attempt, plus the unset case where nothing is added.
I did not add spec.pod to Orchestrator or GPU - the issue scoped it to the three workload CRDs, and the orchestrator builds its pod template differently (it already sets its own pod annotations and has a sandbox path). Easy follow-up if wanted. Only the pod template is touched, so spec.pod.labels do not reach the Deployment's own metadata labels or the Service selector, which is what the acceptance criteria asked for. The focused Ginkgo run needed envtest assets I could not pass inline in this sandbox, so the new specs were verified through the full task test run rather than in isolation.
| Branch | PR #309
Activity
edenreich commentedon Oct 31, 2026
@claude can you work on this? use /ponytail:ponytail /domain-driven-design /clean-architecture /clean-code /go /go-concurrency
inference-gateway-maintainer commentedon Oct 31, 2026
Claude finished @edenreich's task in 6m 15s —— View job •
feat/issue-308-20261031-2255• [Create PR ➔](https://github.com/inference-gateway/operator/compare/main...feat/issue-308-20261031-2255?quick_pull=1&title=Issue%20%23308%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23308%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)spec.podfor Gateway, Agent and MCP - donePodSpectype +spec.podon Gateway/Agent/MCPmanifests/spec.podwith an exampletask fmt,go vet,task lint(0 issues),task test- all passWhat changed
One new API type carries the whole feature:
PodSpecinapi/v1alpha1/pod_types.gowithlabels,annotations,nodeSelector,tolerations,affinity, plus anApplyTo(*corev1.PodTemplateSpec)method. Each workload CRD gainedPod *PodSpec(spec.pod), and each builder callsApplyToon the template it just built -gateway_controller.go,agent_controller.go,mcp_controller.go, one line each.Operator-owned labels and annotations win on a key conflict, so
app: <name>can never be replaced and the Deployment selector plus Services keep working. All three controllers already replace the whole pod template on update, so changing aspec.podfield rolls the Deployment and removing one drops it - no extra code needed.Tests live in
internal/controller/pod_spec_test.go: a table over the Gateway/Agent/MCP builders asserting every field passes through and theapplabel survives a hijack attempt, plus the unset case where nothing is added.Also filed inference-gateway/docs#1059 for the user-facing docs.
Not done / risk
I did not add
spec.podtoOrchestratororGPU- the issue scoped it to the three workload CRDs, and the orchestrator builds its pod template differently (it already sets its own pod annotations and has a sandbox path). Easy follow-up if wanted. Only the pod template is touched, sospec.pod.labelsdo not reach the Deployment's own metadata labels or the Service selector, which is what the acceptance criteria asked for. The focused Ginkgo run needed envtest assets I could not pass inline in this sandbox, so the new specs were verified through the fulltask testrun rather than in isolation.| Branch | PR #309
docs(examples): run the NetBird example's gateway from an operator Ga…
inference-gateway-releaser commentedon Oct 31, 2026
🎉 This issue has been resolved in version 0.30.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
docs(examples): pin the NetBird example's gateway with operator v0.30…
docs(examples): run the NetBird example's gateway from an operator Ga…
docs(examples): pin the NetBird example's gateway with operator v0.30…
docs(examples): add kubernetes-session-teleport-netbird to teleport o…