Skip to content

Commit 6559275

Browse files
committed
add dashboard demo to k8s
Signed-off-by: JaredforReal <[email protected]>
1 parent e48c9a7 commit 6559275

File tree

2 files changed

+98
-20
lines changed

2 files changed

+98
-20
lines changed

dashboard/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,56 @@ curl http://localhost:8700/healthz
283283
# Returns: {"status":"healthy","service":"semantic-router-dashboard"}
284284
```
285285

286+
### Kubernetes deployment
287+
288+
The manifest at `dashboard/deploy/kubernetes/deployment.yaml` includes:
289+
290+
- Deployment with args `-port=8700 -static=/app/frontend -config=/app/config/config.yaml`
291+
- Service (ClusterIP) exposing port 80 → container port 8700
292+
- ConfigMap `semantic-router-dashboard-config` for upstream targets (`TARGET_*` env)
293+
- ConfigMap `semantic-router-config` to provide a minimal `config.yaml` (replace with your real one)
294+
295+
Quick start:
296+
297+
```bash
298+
# Set your namespace and apply
299+
kubectl create ns vllm-semantic-router-system --dry-run=client -o yaml | kubectl apply -f -
300+
kubectl -n vllm-semantic-router-system apply -f dashboard/deploy/kubernetes/deployment.yaml
301+
302+
# Port-forward for local testing
303+
kubectl -n vllm-semantic-router-system port-forward svc/semantic-router-dashboard 8700:80
304+
# Open http://localhost:8700
305+
```
306+
307+
Notes:
308+
309+
- Edit `semantic-router-dashboard-config` in the YAML to match your in-cluster service DNS names and namespace.
310+
- Replace `semantic-router-config` content with your actual `config.yaml` or mount a Secret/ConfigMap you already manage.
311+
- To expose externally, add an Ingress or Service of type LoadBalancer according to your cluster.
312+
313+
Optional Ingress example (Nginx Ingress):
314+
315+
```yaml
316+
apiVersion: networking.k8s.io/v1
317+
kind: Ingress
318+
metadata:
319+
name: semantic-router-dashboard
320+
annotations:
321+
kubernetes.io/ingress.class: nginx
322+
spec:
323+
rules:
324+
- host: dashboard.example.com
325+
http:
326+
paths:
327+
- path: /
328+
pathType: Prefix
329+
backend:
330+
service:
331+
name: semantic-router-dashboard
332+
port:
333+
number: 80
334+
```
335+
286336
## Notes
287337

288338
- The dashboard is a runtime operator/try-it surface, not docs. See repository docs for broader guides.

dashboard/deploy/kubernetes/deployment.yaml

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,46 @@ spec:
1818
- name: dashboard
1919
image: ghcr.io/vllm-project/semantic-router/dashboard:latest
2020
imagePullPolicy: IfNotPresent
21-
args: ["-port=8700", "-static=/app/frontend"]
21+
args: ["-port=8700", "-static=/app/frontend", "-config=/app/config/config.yaml"]
2222
env:
2323
- name: TARGET_GRAFANA_URL
24-
value: http://grafana.vllm-semantic-router-system.svc.cluster.local:3000
24+
valueFrom:
25+
configMapKeyRef:
26+
name: semantic-router-dashboard-config
27+
key: TARGET_GRAFANA_URL
2528
- name: TARGET_PROMETHEUS_URL
26-
value: http://prometheus.vllm-semantic-router-system.svc.cluster.local:9090
29+
valueFrom:
30+
configMapKeyRef:
31+
name: semantic-router-dashboard-config
32+
key: TARGET_PROMETHEUS_URL
2733
- name: TARGET_ROUTER_API_URL
28-
value: http://semantic-router.vllm-semantic-router-system.svc.cluster.local:8080
34+
valueFrom:
35+
configMapKeyRef:
36+
name: semantic-router-dashboard-config
37+
key: TARGET_ROUTER_API_URL
2938
- name: TARGET_ROUTER_METRICS_URL
30-
value: http://semantic-router.vllm-semantic-router-system.svc.cluster.local:9190/metrics
39+
valueFrom:
40+
configMapKeyRef:
41+
name: semantic-router-dashboard-config
42+
key: TARGET_ROUTER_METRICS_URL
3143
- name: TARGET_OPENWEBUI_URL
32-
value: ""
44+
valueFrom:
45+
configMapKeyRef:
46+
name: semantic-router-dashboard-config
47+
key: TARGET_OPENWEBUI_URL
48+
- name: ROUTER_CONFIG_PATH
49+
value: /app/config/config.yaml
3350
ports:
3451
- name: http
3552
containerPort: 8700
3653
volumeMounts:
37-
- name: frontend
38-
mountPath: /app/frontend
54+
- name: router-config
55+
mountPath: /app/config
56+
readOnly: true
3957
volumes:
40-
- name: frontend
58+
- name: router-config
4159
configMap:
42-
name: semantic-router-dashboard-frontend
60+
name: semantic-router-config
4361
---
4462
apiVersion: v1
4563
kind: Service
@@ -59,14 +77,24 @@ spec:
5977
apiVersion: v1
6078
kind: ConfigMap
6179
metadata:
62-
name: semantic-router-dashboard-frontend
80+
name: semantic-router-dashboard-config
6381
data:
64-
index.html: |
65-
<!doctype html>
66-
<html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Semantic Router Dashboard</title></head>
67-
<body>
68-
<script>
69-
// Fallback page that redirects to container-mounted frontend if available
70-
window.location.replace('/');
71-
</script>
72-
</body></html>
82+
TARGET_GRAFANA_URL: http://grafana.vllm-semantic-router-system.svc.cluster.local:3000
83+
TARGET_PROMETHEUS_URL: http://prometheus.vllm-semantic-router-system.svc.cluster.local:9090
84+
TARGET_ROUTER_API_URL: http://semantic-router.vllm-semantic-router-system.svc.cluster.local:8080
85+
TARGET_ROUTER_METRICS_URL: http://semantic-router.vllm-semantic-router-system.svc.cluster.local:9190/metrics
86+
TARGET_OPENWEBUI_URL: ""
87+
88+
---
89+
apiVersion: v1
90+
kind: ConfigMap
91+
metadata:
92+
name: semantic-router-config
93+
data:
94+
# Minimal config.yaml to let /api/router/config/all return something.
95+
# Replace with your real configuration or mount a different ConfigMap/Secret.
96+
config.yaml: |
97+
default_model: example-model
98+
default_reasoning_effort: medium
99+
vllm_endpoints: []
100+
model_config: {}

0 commit comments

Comments
 (0)