Skip to content

Commit 30801fa

Browse files
authored
[Feat] helm: use downloader image and add global.imageRegistry support (#759)
Signed-off-by: samzong <[email protected]>
1 parent 87f9cec commit 30801fa

File tree

7 files changed

+20
-7
lines changed

7 files changed

+20
-7
lines changed

deploy/helm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ helm install semantic-router ./deploy/helm/semantic-router \
4848
--create-namespace
4949
```
5050

51+
> Need a registry mirror/proxy (e.g., in China)? Append `--set global.imageRegistry=<your-registry>` to any Helm install/upgrade command.
52+
5153
### Verify Installation
5254

5355
```bash

deploy/helm/semantic-router/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ kubectl apply -f deploy/helm/semantic-router/crds/
228228
| env[0].value | string | `"/app/lib"` | |
229229
| fullnameOverride | string | `""` | Override the full name of the chart |
230230
| global.namespace | string | `""` | Namespace for all resources (if not specified, uses Release.Namespace) |
231+
| global.imageRegistry | string | `""` | Optional registry prefix applied to all images (e.g., mirror registry in China) |
231232
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
232233
| image.repository | string | `"ghcr.io/vllm-project/semantic-router/extproc"` | Image repository |
233234
| image.tag | string | `"latest"` | Image tag (overrides the image tag whose default is the chart appVersion) |
@@ -238,7 +239,7 @@ kubectl apply -f deploy/helm/semantic-router/crds/
238239
| ingress.hosts | list | `[{"host":"semantic-router.local","paths":[{"path":"/","pathType":"Prefix","servicePort":8080}]}]` | Ingress hosts configuration |
239240
| ingress.tls | list | `[]` | Ingress TLS configuration |
240241
| initContainer.enabled | bool | `true` | Enable init container |
241-
| initContainer.image | string | `"python:3.11-slim"` | Init container image |
242+
| initContainer.image | object | `{ "repository": "ghcr.io/vllm-project/semantic-router/model-downloader", "tag": "" (defaults to chart appVersion), "pullPolicy": "IfNotPresent" }` | Init container image |
242243
| initContainer.models | list | `[{"name":"all-MiniLM-L12-v2","repo":"sentence-transformers/all-MiniLM-L12-v2"},{"name":"category_classifier_modernbert-base_model","repo":"LLM-Semantic-Router/category_classifier_modernbert-base_model"},{"name":"pii_classifier_modernbert-base_model","repo":"LLM-Semantic-Router/pii_classifier_modernbert-base_model"},{"name":"jailbreak_classifier_modernbert-base_model","repo":"LLM-Semantic-Router/jailbreak_classifier_modernbert-base_model"},{"name":"pii_classifier_modernbert-base_presidio_token_model","repo":"LLM-Semantic-Router/pii_classifier_modernbert-base_presidio_token_model"}]` | Models to download |
243244
| initContainer.resources | object | `{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}}` | Resource limits for init container |
244245
| livenessProbe.enabled | bool | `true` | Enable liveness probe |

deploy/helm/semantic-router/templates/deployment.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,23 @@ spec:
2626
imagePullSecrets:
2727
{{- toYaml . | nindent 8 }}
2828
{{- end }}
29+
{{- $registry := trimSuffix "/" (default "" .Values.global.imageRegistry) }}
30+
{{- $prefix := ternary "" (printf "%s/" $registry) (eq $registry "") }}
2931
serviceAccountName: {{ include "semantic-router.serviceAccountName" . }}
3032
securityContext:
3133
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3234
{{- if .Values.initContainer.enabled }}
3335
initContainers:
3436
- name: model-downloader
35-
image: {{ .Values.initContainer.image }}
37+
{{- $initImage := .Values.initContainer.image }}
38+
image: "{{ $prefix }}{{ $initImage.repository }}:{{ $initImage.tag | default .Chart.AppVersion }}"
39+
imagePullPolicy: {{ $initImage.pullPolicy | default "IfNotPresent" }}
3640
securityContext:
3741
{{- toYaml .Values.securityContext | nindent 10 }}
3842
command: ["/bin/bash", "-c"]
3943
args:
4044
- |
4145
set -e
42-
echo "Installing Hugging Face Hub..."
43-
pip install -U --no-cache-dir "huggingface_hub>=0.19.0"
44-
4546
echo "Downloading models to persistent volume..."
4647
cd /app/models
4748
@@ -79,7 +80,7 @@ spec:
7980
{{- end }}
8081
containers:
8182
- name: {{ .Chart.Name }}
82-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
83+
image: "{{ $prefix }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
8384
imagePullPolicy: {{ .Values.image.pullPolicy }}
8485
{{- with .Values.args }}
8586
args:

deploy/helm/semantic-router/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
global:
77
# -- Namespace for all resources (if not specified, uses Release.Namespace)
88
namespace: ""
9+
# -- Optional registry prefix applied to all images (e.g., mirror in China such as registry.cn-hangzhou.aliyuncs.com)
10+
imageRegistry: ""
911

1012
# -- Number of replicas for the deployment
1113
replicaCount: 1
@@ -131,7 +133,11 @@ initContainer:
131133
# -- Enable init container
132134
enabled: true
133135
# -- Init container image
134-
image: python:3.11-slim
136+
image:
137+
repository: ghcr.io/vllm-project/semantic-router/model-downloader
138+
# Leave empty to default to the chart AppVersion; override with a pinned tag if desired
139+
tag: ""
140+
pullPolicy: IfNotPresent
135141
# -- Resource limits for init container
136142
resources:
137143
limits:

website/docs/installation/k8s/ai-gateway.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Deploy the semantic router service with all required components using Helm:
103103

104104
```bash
105105
# Install with custom values from GHCR OCI registry
106+
# (Optional) If you use a registry mirror/proxy, append: --set global.imageRegistry=<your-registry>
106107
helm install semantic-router oci://ghcr.io/vllm-project/charts/semantic-router \
107108
--version v0.0.0-latest \
108109
--namespace vllm-semantic-router-system \

website/docs/installation/k8s/aibrix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Deploy the semantic router service with all required components using Helm:
5656

5757
```bash
5858
# Install with custom values from GHCR OCI registry
59+
# (Optional) If you use a registry mirror/proxy, append: --set global.imageRegistry=<your-registry>
5960
helm install semantic-router oci://ghcr.io/vllm-project/charts/semantic-router \
6061
--version v0.0.0-latest \
6162
--namespace vllm-semantic-router-system \

website/docs/installation/k8s/production-stack.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Deploy using Helm with custom values:
9999

100100
```bash
101101
# Deploy vLLM Semantic Router with custom values from GHCR OCI registry
102+
# (Optional) If you use a registry mirror/proxy, append: --set global.imageRegistry=<your-registry>
102103
helm install semantic-router oci://ghcr.io/vllm-project/charts/semantic-router \
103104
--version v0.0.0-latest \
104105
--namespace vllm-semantic-router-system \

0 commit comments

Comments
 (0)