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] Sidecar containers and volumes in spec.pod for Gateway, Agent and MCP workloads #316
The workload CRDs cannot add containers or volumes to the pods the operator creates. spec.pod (#308) covers labels, annotations and scheduling, which is enough when a webhook injects the sidecar, such as Istio, Linkerd or the NetBird operator. A VPN or proxy without an injector needs the sidecar in the pod spec itself, and there is no field for it.
Found while building examples/kubernetes-session-teleport-headscale in inference-gateway/cli (inference-gateway/cli#1665). Every tailnet pod there runs a tailscale/tailscale sidecar. Headscale ships no injector, and Tailscale's own Kubernetes operator needs the Tailscale API, which Headscale does not implement. So the Gateway cannot join the tailnet, and the example puts a separate tailscale proxy pod in front of the Gateway Service until this lands.
Proposed shape, the same on every workload CRD (Gateway, Agent, MCP):
containers are appended after the operator's own container. initContainers allows native sidecars (restartPolicy: Always) and setup steps. volumes are added to the pod, so the extra containers can mount them.
Acceptance Criteria
Gateway, Agent and MCP accept spec.pod.containers, spec.pod.initContainers and spec.pod.volumes, applied to the pod template of the Deployment each creates
The operator's own container stays first and unchanged, and its volumes keep their names. A user container or volume whose name collides with an operator-owned one is rejected with a clear error (validation or a status condition)
Changing any of these fields rolls the Deployment, and removing an entry removes it from the pod template
Controller tests cover each field, including the name collision, and the README documents them with a sidecar example
PodSpec was already shared by all three CRDs with a single ApplyTo call, so the feature went in once in api/v1alpha1/pod_types.go and Gateway, Agent and MCP all got it.
Read PodSpec.ApplyTo and the three Deployment builders
spec.pod.containers / initContainers / volumes added to PodSpec, appended in ApplyTo (operator container stays first and untouched, its volumes keep their names)
ValidatePodTemplateNames rejects a name the operator already owns, called from each reconcileDeployment before the Deployment is written - error reads spec.pod.containers: "inference-gateway" is already used by the operator
Regenerated deepcopy, CRDs and manifests/
internal/controller/pod_spec_test.go covers the three fields per workload, the unset case, and a container- and volume-name collision per CRD
README documents the fields with the Tailscale sidecar example
task lint clean, task test green (controller coverage 71.6%)
Rolling and removal needed no code: all three controllers already replace the whole pod template when it differs from the live one.
Two things worth your call:
Manifest size. Embedding the Kubernetes container/volume schemas three times takes the Gateway CRD from 196 KB to 542 KB and manifests/install.yaml from 505 KB to 1.5 MB. Under the per-object etcd limit, but a client-side kubectl apply stores a second copy in last-applied-configuration, so --server-side is now the safe install path. The alternative (a schemaless, unvalidated field) would have thrown away all validation.
AgentReconciler.reconcileDeployment now returns only error - its *Deployment result was never used and unparam flagged it once a test called the function.
Activity
edenreich commentedon Nov 1, 2026
@claude can you work on this? use /ponytail:ponytail /go /go-concurrency
inference-gateway-maintainer commentedon Nov 1, 2026
Claude finished @edenreich's task in 10m 19s —— View job •
feat/issue-316-20261101-2010Done - PR #317
PodSpecwas already shared by all three CRDs with a singleApplyTocall, so the feature went in once inapi/v1alpha1/pod_types.goandGateway,AgentandMCPall got it.PodSpec.ApplyToand the three Deployment buildersspec.pod.containers/initContainers/volumesadded toPodSpec, appended inApplyTo(operator container stays first and untouched, its volumes keep their names)ValidatePodTemplateNamesrejects a name the operator already owns, called from eachreconcileDeploymentbefore the Deployment is written - error readsspec.pod.containers: "inference-gateway" is already used by the operatormanifests/internal/controller/pod_spec_test.gocovers the three fields per workload, the unset case, and a container- and volume-name collision per CRDtask lintclean,task testgreen (controller coverage 71.6%)Rolling and removal needed no code: all three controllers already replace the whole pod template when it differs from the live one.
Two things worth your call:
manifests/install.yamlfrom 505 KB to 1.5 MB. Under the per-object etcd limit, but a client-sidekubectl applystores a second copy inlast-applied-configuration, so--server-sideis now the safe install path. The alternative (a schemaless, unvalidated field) would have thrown away all validation.AgentReconciler.reconcileDeploymentnow returns onlyerror- its*Deploymentresult was never used andunparamflagged it once a test called the function.Filed alongside: inference-gateway/docs#1074 (docs) and inference-gateway/cli#1675 (the headscale example can drop its proxy pod once this is released). Board item moved to QA.
Create a PR - already opened as #317.
| branch
inference-gateway-releaser commentedon Nov 1, 2026
🎉 This issue has been resolved in version 0.32.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀