feat(deploy): add container image, Helm chart and Envoy AI Gateway, litellm examples - #319
feat(deploy): add container image, Helm chart and Envoy AI Gateway, litellm examples#319ansjindal wants to merge 6 commits into
Conversation
…amples Signed-off-by: ansjindal <ansjindal@nvidia.com>
WalkthroughThe change adds a production Docker image, a configurable Helm chart, Kubernetes deployment resources, and two Envoy AI Gateway integration examples. ChangesSwitchyard deployment packaging
Estimated code review effort: 5 (Critical) | ~120 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deploy/helm/switchyard/templates/deployment.yaml`:
- Around line 80-85: Update the deployment health probe definitions to render
scheme: HTTPS when .Values.tls.enabled is true and no custom probe scheme is
configured. Preserve any explicitly configured scheme and the existing HTTP
behavior when TLS is disabled.
In `@deploy/helm/switchyard/templates/pdb.yaml`:
- Around line 13-16: Update the podDisruptionBudget conditional so it checks
whether maxUnavailable differs from its unset default "" rather than relying on
truthiness. This must preserve and render an explicit numeric maxUnavailable
value of 0; only an unset maxUnavailable should select minAvailable.
In `@examples/kubernetes/README.md`:
- Around line 102-105: Update the primary Kubernetes installation sequence in
the README to create the switchyard-client-keys secret and apply
04-client-auth.yaml before exposing the topology. Update the corresponding
request example to include the required x-api-key header, preserving the
existing installation and request flow.
In `@examples/kubernetes/switchyard-in-front-of-envoy-ai-gateway/01-gateway.yaml`:
- Around line 43-49: Add a NetworkPolicy in the envoy-gateway-system resources
that targets the generated Envoy workload and permits ingress only from
Switchyard client pods selected by both the switchyard namespace and the
authorized pod labels. Verify the generated Envoy labels used by the policy
match the deployed workload, while preserving the existing ClusterIP service
configuration.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7497c1e2-f427-4afd-a068-b3a5c7e55dd9
📒 Files selected for processing (28)
.dockerignoreDockerfiledeploy/helm/switchyard/.helmignoredeploy/helm/switchyard/Chart.yamldeploy/helm/switchyard/README.mddeploy/helm/switchyard/templates/NOTES.txtdeploy/helm/switchyard/templates/_helpers.tpldeploy/helm/switchyard/templates/configmap.yamldeploy/helm/switchyard/templates/deployment.yamldeploy/helm/switchyard/templates/extra-objects.yamldeploy/helm/switchyard/templates/hpa.yamldeploy/helm/switchyard/templates/pdb.yamldeploy/helm/switchyard/templates/secret.yamldeploy/helm/switchyard/templates/service.yamldeploy/helm/switchyard/templates/serviceaccount.yamldeploy/helm/switchyard/templates/servicemonitor.yamldeploy/helm/switchyard/values.yamlexamples/kubernetes/README.mdexamples/kubernetes/envoy-ai-gateway-in-front/01-gateway.yamlexamples/kubernetes/envoy-ai-gateway-in-front/02-switchyard-backend.yamlexamples/kubernetes/envoy-ai-gateway-in-front/03-forwarded-host.yamlexamples/kubernetes/envoy-ai-gateway-in-front/04-client-auth.yamlexamples/kubernetes/envoy-ai-gateway-in-front/values.switchyard.yamlexamples/kubernetes/switchyard-in-front-of-envoy-ai-gateway/01-gateway.yamlexamples/kubernetes/switchyard-in-front-of-envoy-ai-gateway/02-provider-backend.yamlexamples/kubernetes/switchyard-in-front-of-envoy-ai-gateway/03-forwarded-host.yamlexamples/kubernetes/switchyard-in-front-of-envoy-ai-gateway/04-restrict-access.yamlexamples/kubernetes/switchyard-in-front-of-envoy-ai-gateway/values.switchyard.yaml
…ct gateway access Signed-off-by: ansjindal <ansjindal@nvidia.com>
…rnetes README Signed-off-by: ansjindal <ansjindal@nvidia.com>
Signed-off-by: ansjindal <ansjindal@nvidia.com>
Signed-off-by: ansjindal <ansjindal@nvidia.com>
Signed-off-by: ansjindal <ansjindal@nvidia.com>
What
Adds the packaging needed to run
switchyard-serveron Kubernetes:Dockerfile— multi-stage release build of theswitchyard-serverbinary on
debian:bookworm-slim. 40 MB, runs as UID 65532, works under aread-only root filesystem. Distinct from
benchmark/*.Dockerfile, whichbuild the Python launcher for benchmark harnesses.
.dockerignore— addstarget. Currently absent, so any build from adeveloper checkout ships a multi-gigabyte Rust build directory as context.
deploy/helm/switchyard/— chart for the standalone proxy: deploymentTOML rendered into a ConfigMap, provider keys from a Secret, health probes,
graceful-shutdown-aware termination, and optional ServiceMonitor, PDB, HPA,
TLS and routing-log volumes.
examples/kubernetes/— Envoy AI Gateway integration in bothdirections, along with LiteLLM.
No Rust or Python source is touched; this is additive packaging only.
Its solving: #318
Why
switchyard-serveralready behaves like a Kubernetes workload — one portserving the LLM API,
/healthand/metrics; credentials read fromenvironment variables named by
api_key_envrather than baked into config;SIGTERM draining in-flight requests for
--shutdown-timeout. What is missingis the packaging that turns those properties into a deployment, so every
adopter currently rebuilds it.
The Envoy AI Gateway examples are included because the two projects solve
adjacent problems and compose in both directions, with materially different
security properties:
BackendSecurityPolicy, never in the podSecurityPolicyon the GatewayHow tested
uv run ruff check .clean — not run; no Python changed. CI covers it.uv run mypy switchyardclean — not run; no Python changed.uv run pytest tests/green — not run; no Python changed.Cluster: single-node k3s v1.34.10, Envoy Gateway v1.8.3, Envoy AI Gateway
v1.0.0, against
nemotron-3-nano-30b-a3b,-super-v3and-ultra.Image:
switchyard-server --versionreports0.2.0--config routes.toml --dry-runexits non-zero on a missingapi_key_envand zero on a valid deployment
Chart:
helm lint --strictclean; renders against both example values files/health200,/v1/modelslists the configured route ids,/metricsexports
switchyard_build_info{version="0.2.0"}checksum/configannotationBoth topologies:
Programmed=True; everyAIGatewayRoute,AIServiceBackend,Backend,BackendSecurityPolicyreportsAcceptedx-model-router-selected-modelshowing the tier Switchyard pickedschema.prefixpath rewrite, upstream TLS to the providerChecklist
snake_caseof the primary class. —N/A, no source files.
switchyard/__init__.py.__all__. —N/A, no public API change.
change. Validation is the manual smoke above; happy to add a kind-based
e2e job if you want one.
--helpupdated if customer-facing surface changed. — no CLIchange; new docs are
deploy/helm/switchyard/README.mdandexamples/kubernetes/README.md.Notes for reviewers
Please confirm the paths before deep review.
deploy/helm/switchyard/andexamples/kubernetes/are guesses at your conventions;charts/is equallyeasy. Likewise the chart defaults
image.repositorytoghcr.io/nvidia-nemo/switchyard/switchyard-server, which does not exist yet —the follow-up branch adds the workflow that would publish it.
Summary by CodeRabbit
New Features
Documentation