Skip to content

Commit ba1df6f

Browse files
authored
[Feat] Add imagePullSecrets support for router and cache-server deployment. (#762)
Signed-off-by: Fang Han <fhan0520@gmail.com>
1 parent a2576d6 commit ba1df6f

File tree

6 files changed

+193
-0
lines changed

6 files changed

+193
-0
lines changed

helm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ This table documents all available configuration values for the Production Stack
159159
| `routerSpec.repository` | string | `"lmcache/lmstack-router"` | Docker image repository for the router |
160160
| `routerSpec.tag` | string | `"latest"` | Docker image tag for the router |
161161
| `routerSpec.imagePullPolicy` | string | `"Always"` | Image pull policy for the router |
162+
| `routerSpec.imagePullSecrets` | list | `[]` | Image pull secrets for private container registries |
162163
| `routerSpec.enableRouter` | boolean | `true` | Whether to enable the router service |
163164
| `routerSpec.replicaCount` | integer | `1` | Number of replicas for the router pod |
164165
| `routerSpec.priorityClassName` | string | `""` | Priority class for router |
@@ -218,6 +219,7 @@ This table documents all available configuration values for the Production Stack
218219
| `cacheserverSpec.image.repository` | string | `"lmcache/lmstack-cache-server"` | Docker image repository for the cache server |
219220
| `cacheserverSpec.image.tag` | string | `"latest"` | Docker image tag for the cache server |
220221
| `cacheserverSpec.image.pullPolicy` | string | `"Always"` | Image pull policy for the cache server |
222+
| `cacheserverSpec.imagePullSecrets` | list | `[]` | Image pull secrets for private container registries |
221223
| `cacheserverSpec.replicaCount` | integer | `1` | Number of replicas for the cache server pod |
222224
| `cacheserverSpec.containerPort` | integer | `8000` | Port the cache server container is listening on |
223225
| `cacheserverSpec.serviceType` | string | `"ClusterIP"` | Kubernetes service type for the cache server |

helm/templates/deployment-cache-server.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ spec:
3131
{{- toYaml . | nindent 12 }}
3232
{{- end }}
3333
{{- end }}
34+
{{- with .Values.cacheserverSpec.imagePullSecrets }}
35+
imagePullSecrets:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
3438
containers:
3539
- name: "lmcache-server"
3640
image: "{{ required "Required value 'cacheserverSpec.repository' must be defined !" .Values.cacheserverSpec.repository }}:{{ required "Required value 'cacheserverSpec.tag' must be defined !" .Values.cacheserverSpec.tag }}"

helm/templates/deployment-router.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ spec:
4141
{{- toYaml . | nindent 12 }}
4242
{{- end }}
4343
{{- end }}
44+
{{- with .Values.routerSpec.imagePullSecrets }}
45+
imagePullSecrets:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
4448
{{- if .Values.routerSpec.securityContext }}
4549
securityContext:
4650
{{- toYaml .Values.routerSpec.securityContext | nindent 8 }}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
suite: test imagePullSecrets configuration
2+
templates:
3+
- deployment-router.yaml
4+
- deployment-vllm-multi.yaml
5+
- deployment-cache-server.yaml
6+
- deployment-lora-controller.yaml
7+
- ray-cluster.yaml
8+
tests:
9+
- it: should set imagePullSecrets for router
10+
set:
11+
routerSpec:
12+
enableRouter: true
13+
imagePullSecrets:
14+
- name: my-registry-secret
15+
asserts:
16+
- template: deployment-router.yaml
17+
equal:
18+
path: spec.template.spec.imagePullSecrets
19+
value:
20+
- name: my-registry-secret
21+
22+
- it: should not set imagePullSecrets for router when not specified
23+
set:
24+
routerSpec:
25+
enableRouter: true
26+
asserts:
27+
- template: deployment-router.yaml
28+
notExists:
29+
path: spec.template.spec.imagePullSecrets
30+
31+
- it: should set imagePullSecret for serving engine model
32+
set:
33+
servingEngineSpec:
34+
enableEngine: true
35+
modelSpec:
36+
- name: "test-model"
37+
repository: "vllm/vllm-openai"
38+
tag: "latest"
39+
modelURL: "facebook/opt-125m"
40+
imagePullSecret: "model-secret"
41+
replicaCount: 1
42+
requestCPU: 1
43+
requestMemory: "1Gi"
44+
requestGPU: 1
45+
asserts:
46+
- template: deployment-vllm-multi.yaml
47+
equal:
48+
path: spec.template.spec.imagePullSecrets
49+
value:
50+
- name: model-secret
51+
52+
- it: should set imagePullSecrets for cache server
53+
set:
54+
cacheserverSpec:
55+
repository: "lmcache/lmstack-cache-server"
56+
tag: "latest"
57+
containerPort: 8000
58+
servicePort: 80
59+
imagePullSecrets:
60+
- name: cache-secret
61+
asserts:
62+
- template: deployment-cache-server.yaml
63+
equal:
64+
path: spec.template.spec.imagePullSecrets
65+
value:
66+
- name: cache-secret
67+
68+
- it: should set imagePullSecrets for lora controller
69+
set:
70+
loraController:
71+
enableLoraController: true
72+
imagePullSecrets:
73+
- name: lora-secret
74+
asserts:
75+
- template: deployment-lora-controller.yaml
76+
equal:
77+
path: spec.template.spec.imagePullSecrets
78+
value:
79+
- name: lora-secret
80+
81+
- it: should set imagePullSecret for ray cluster
82+
set:
83+
servingEngineSpec:
84+
enableEngine: true
85+
modelSpec:
86+
- name: "ray-model"
87+
repository: "vllm/vllm-openai"
88+
tag: "latest"
89+
modelURL: "facebook/opt-125m"
90+
imagePullSecret: "ray-secret"
91+
replicaCount: 2
92+
requestCPU: 1
93+
requestMemory: "1Gi"
94+
requestGPU: 1
95+
raySpec:
96+
enabled: true
97+
headNode:
98+
requestCPU: 1
99+
requestMemory: "1Gi"
100+
requestGPU: 1
101+
asserts:
102+
- template: ray-cluster.yaml
103+
documentIndex: 0
104+
equal:
105+
path: spec.headGroupSpec.template.spec.imagePullSecrets
106+
value:
107+
- name: ray-secret
108+
- template: ray-cluster.yaml
109+
documentIndex: 0
110+
equal:
111+
path: spec.workerGroupSpecs[0].template.spec.imagePullSecrets
112+
value:
113+
- name: ray-secret
114+
115+
- it: should set imagePullSecrets for all components
116+
set:
117+
routerSpec:
118+
enableRouter: true
119+
imagePullSecrets:
120+
- name: router-secret
121+
servingEngineSpec:
122+
enableEngine: true
123+
modelSpec:
124+
- name: "test-model"
125+
repository: "vllm/vllm-openai"
126+
tag: "latest"
127+
modelURL: "facebook/opt-125m"
128+
imagePullSecret: "model-secret"
129+
replicaCount: 1
130+
requestCPU: 1
131+
requestMemory: "1Gi"
132+
requestGPU: 1
133+
loraController:
134+
enableLoraController: true
135+
imagePullSecrets:
136+
- name: lora-secret
137+
cacheserverSpec:
138+
repository: "lmcache/lmstack-cache-server"
139+
tag: "latest"
140+
containerPort: 8000
141+
servicePort: 80
142+
imagePullSecrets:
143+
- name: cache-secret
144+
asserts:
145+
- template: deployment-router.yaml
146+
equal:
147+
path: spec.template.spec.imagePullSecrets[0].name
148+
value: router-secret
149+
- template: deployment-vllm-multi.yaml
150+
equal:
151+
path: spec.template.spec.imagePullSecrets[0].name
152+
value: model-secret
153+
- template: deployment-lora-controller.yaml
154+
equal:
155+
path: spec.template.spec.imagePullSecrets[0].name
156+
value: lora-secret
157+
- template: deployment-cache-server.yaml
158+
equal:
159+
path: spec.template.spec.imagePullSecrets[0].name
160+
value: cache-secret

helm/values.schema.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
"tag": {
6565
"type": "string"
6666
},
67+
"imagePullSecret": {
68+
"type": "string",
69+
"description": "Name of secret with credentials to private container repository"
70+
},
6771
"modelURL": {
6872
"type": "string"
6973
},
@@ -478,6 +482,19 @@
478482
"replicaCount": {
479483
"type": "integer"
480484
},
485+
"imagePullSecrets": {
486+
"type": "array",
487+
"description": "Image pull secrets for private container registries",
488+
"items": {
489+
"type": "object",
490+
"properties": {
491+
"name": {
492+
"type": "string"
493+
}
494+
},
495+
"required": ["name"]
496+
}
497+
},
481498
"autoscaling": {
482499
"type": "object",
483500
"properties": {

helm/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ routerSpec:
319319
# -- Container-level security context configuration. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#securitycontext-v1-core
320320
containerSecurityContext: {}
321321

322+
# -- Image pull secrets for private container registries
323+
# Example:
324+
# imagePullSecrets:
325+
# - name: my-registry-secret
326+
imagePullSecrets: []
327+
322328
# -- Whether to enable the router service
323329
enableRouter: true
324330

0 commit comments

Comments
 (0)