Repository navigation
feat(helm): add Helm chart for SMG router deployment #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
79adf2c
docs: add Helm chart design document
slin1237 103fc0f
docs: add Helm chart implementation plan
slin1237 a086184
feat(helm): scaffold chart with Chart.yaml and helmignore
slin1237 5e33b83
feat(helm): add values.yaml with all configuration sections
slin1237 7278ab6
feat(helm): add template helpers with router args builder
slin1237 b568bae
feat(helm): add router deployment, service, serviceaccount, and secre…
slin1237 edf5c6e
fix(helm): fix template rendering issues
slin1237 92fb28f
feat(helm): add RBAC templates for service discovery
slin1237 54c56fb
feat(helm): add ingress, HPA, PDB, ServiceMonitor, and Grafana dashbo…
slin1237 e159ea3
feat(helm): add worker deployment and service templates
slin1237 9be53d8
feat(helm): add PD disaggregation prefill and decode templates
slin1237 5b0e73e
feat(helm): add helm test for router health check
slin1237 5e4f56d
feat(helm): add JSON Schema validation for values
slin1237 371b655
docs(helm): add example values for all deployment scenarios
slin1237 b3e0410
docs(helm): add comprehensive README with quickstart and examples
slin1237 9dfecd8
refactor(helm): simplify chart to router-only mode
slin1237 64e5c0d
fix(helm): address PR review feedback for CLI flags and env vars
slin1237 c65c895
fix(helm): address CodeRabbit review feedback
slin1237 42c0991
fix(helm): fix CLI flags for Python entrypoint, address remaining rev…
slin1237 aed0e84
fix(helm): add --enable-trace flag and fix history.backend=none handling
slin1237 2c0c56b
fix(helm): fix CLI flag mismatches, add securityContext and configura…
slin1237 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .git | ||
| .gitignore | ||
| examples/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| apiVersion: v2 | ||
| name: smg | ||
| description: "Shepherd Model Gateway - high-performance inference router for LLM deployments" | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "0.7.0" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| kubeVersion: ">=1.26.0-0" | ||
| home: https://github.com/lightseekorg/smg | ||
| sources: | ||
| - https://github.com/lightseekorg/smg | ||
| maintainers: | ||
| - name: LightSeek | ||
| url: https://github.com/lightseekorg | ||
| keywords: | ||
| - llm | ||
| - inference | ||
| - gateway | ||
| - router | ||
| - sglang | ||
| - vllm | ||
| # dependencies: | ||
| # - name: postgresql | ||
| # version: "~16" | ||
| # repository: https://charts.bitnami.com/bitnami | ||
| # condition: history.postgres.deploy | ||
| # - name: redis | ||
| # version: "~20" | ||
| # repository: https://charts.bitnami.com/bitnami | ||
| # condition: history.redis.deploy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # SMG Helm Chart | ||
|
|
||
| Helm chart for deploying the Shepherd Model Gateway (SMG) — a high-performance inference router for LLM deployments. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Kubernetes >= 1.26 | ||
| - Helm >= 3.12 | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```bash | ||
| helm install smg deploy/helm/smg \ | ||
| --set router.workerUrls[0]=http://worker-1:8000 \ | ||
| --set router.workerUrls[1]=http://worker-2:8000 | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| See [`values.yaml`](values.yaml) for the full list of configurable parameters. | ||
|
|
||
| ### Key Sections | ||
|
|
||
| | Section | Description | | ||
| |---------|-------------| | ||
| | `global` | Image registry, pull secrets | | ||
| | `router` | Router deployment, routing policy, networking, observability | | ||
| | `auth` | API key authentication, rate limiting | | ||
| | `history` | Storage backend (none/memory/postgres/redis/oracle) | | ||
| | `serviceAccount` | Service account creation and annotations | | ||
| | `rbac` | RBAC for Kubernetes service discovery | | ||
|
|
||
| ### Routing Policies | ||
|
|
||
| `cache_aware` (default), `round_robin`, `power_of_two`, `consistent_hashing`, `prefix_hash`, `manual`, `random`, `bucket` | ||
|
|
||
| ## Examples | ||
|
|
||
| | File | Scenario | | ||
| |------|----------| | ||
| | [`router-only.yaml`](examples/router-only.yaml) | Minimal router with external workers | | ||
| | [`with-postgres.yaml`](examples/with-postgres.yaml) | PostgreSQL history backend | | ||
| | [`with-service-discovery.yaml`](examples/with-service-discovery.yaml) | K8s auto-discovery | | ||
| | [`with-ingress.yaml`](examples/with-ingress.yaml) | Ingress with TLS | | ||
| | [`with-monitoring.yaml`](examples/with-monitoring.yaml) | ServiceMonitor + Grafana dashboard | | ||
|
|
||
| ## Testing | ||
|
|
||
| ```bash | ||
| helm test smg | ||
| ``` | ||
|
|
||
| ## Upgrading | ||
|
|
||
| ### 0.1.0 | ||
|
|
||
| Initial release. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Service discovery not finding pods | ||
|
|
||
| Verify RBAC is enabled and the selector matches your worker pod labels: | ||
|
|
||
| ```bash | ||
| kubectl get role,rolebinding -l app.kubernetes.io/instance=smg | ||
| kubectl get pods -l <your-selector> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Minimal router-only deployment pointing at existing workers. | ||
| # Usage: helm install smg deploy/helm/smg -f deploy/helm/smg/examples/router-only.yaml | ||
| router: | ||
| workerUrls: | ||
| - http://worker-1.default.svc:8000 | ||
| - http://worker-2.default.svc:8000 | ||
| policy: cache_aware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Router with Ingress and TLS. | ||
| # Usage: helm install smg deploy/helm/smg -f deploy/helm/smg/examples/with-ingress.yaml | ||
| router: | ||
| workerUrls: | ||
| - http://worker-1:8000 | ||
| ingress: | ||
| enabled: true | ||
| className: nginx | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/proxy-read-timeout: "1800" | ||
| nginx.ingress.kubernetes.io/proxy-send-timeout: "1800" | ||
| hosts: | ||
| - host: smg.example.com | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| tls: | ||
| - secretName: smg-tls | ||
| hosts: | ||
| - smg.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Router with Prometheus ServiceMonitor and Grafana dashboard. | ||
| # Usage: helm install smg deploy/helm/smg -f deploy/helm/smg/examples/with-monitoring.yaml | ||
| router: | ||
| workerUrls: | ||
| - http://worker-1:8000 | ||
| metrics: | ||
| serviceMonitor: | ||
| enabled: true | ||
| interval: 15s | ||
| labels: | ||
| release: prometheus | ||
| grafana: | ||
| dashboard: | ||
| enabled: true | ||
| labels: | ||
| grafana_dashboard: "1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Router with PostgreSQL history backend. | ||
| # Usage: helm install smg deploy/helm/smg -f deploy/helm/smg/examples/with-postgres.yaml | ||
| router: | ||
| workerUrls: | ||
| - http://worker-1:8000 | ||
| history: | ||
| backend: postgres | ||
| postgres: | ||
| url: "postgresql://smg:<YOUR_PASSWORD>@postgres:5432/smg" # replace with real credentials | ||
| poolMax: 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Router with Kubernetes service discovery (auto-discover worker pods). | ||
| # Usage: helm install smg deploy/helm/smg -f deploy/helm/smg/examples/with-service-discovery.yaml | ||
| router: | ||
| policy: cache_aware | ||
| serviceDiscovery: | ||
| enabled: true | ||
| selector: "app=sglang-worker" | ||
| port: 8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| {{- $fullname := include "smg.fullname" . -}} | ||
|
|
||
| Router: | ||
| Endpoint: http://{{ $fullname }}-router:{{ .Values.router.service.port }} | ||
| Metrics: http://{{ $fullname }}-router:{{ .Values.router.metrics.port }}/metrics | ||
| Policy: {{ .Values.router.policy }} | ||
|
|
||
| {{- if .Values.router.ingress.enabled }} | ||
|
|
||
| Ingress: | ||
| {{- range .Values.router.ingress.hosts }} | ||
| http{{ if $.Values.router.ingress.tls }}s{{ end }}://{{ .host }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| To test the deployment: | ||
| helm test {{ .Release.Name }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.