Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions templates/http/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,47 @@ spec:
labels:
app.kubernetes.io/instance: {{values.name}}
spec:
{%- if values.vllmSelected == nil or not(values.vllmSelected) %}
initContainers:
- name: model-file
image: {{values.initContainer}}
command: ['/usr/bin/install', "/model/model.file", "/shared/"]
volumeMounts:
- name: model-file
mountPath: /shared
{%- endif %}
containers:
- env:
- name: MODEL_ENDPOINT
value: http://0.0.0.0:{{values.modelServicePort}}
{%- if values.vllmSelected %}
- name: MODEL_NAME
value: "{{values.vllmModelName}}"
{%- endif %}
image: {{values.appContainer}}
name: app-inference
ports:
- containerPort: {{values.appPort}}
securityContext:
runAsNonRoot: true
{%- if values.vllmSelected %}
- image: {{values.vllmModelServiceContainer}}
args: [
"--model",
"{{values.vllmModelName}}",
"--port",
"{{values.modelServicePort}}",
"--download-dir",
"/models-cache"]
resources:
limits:
nvidia.com/gpu: '1'
volumeMounts:
- name: dshm
mountPath: /dev/shm
- name: models-cache
mountPath: /models-cache
{%- else %}
- env:
- name: HOST
value: "0.0.0.0"
Expand All @@ -47,14 +71,31 @@ spec:
- name: MODEL_PATH
value: /model/model.file
image: {{values.modelServiceContainer}}
volumeMounts:
- name: model-file
mountPath: /model
{%- endif %}
name: app-model-service
ports:
- containerPort: {{values.modelServicePort}}
securityContext:
runAsNonRoot: true
volumeMounts:
- name: model-file
mountPath: /model
{%- if values.vllmSelected %}
volumes:
- name: dshm
emptyDir:
medium: Memory
sizeLimit: "2Gi"
- name: models-cache
persistentVolumeClaim:
claimName: vllm-models-cache

tolerations:
- key: nvidia.com/gpu
operator: Exists
effect: NoSchedule
{%- else %}
volumes:
- name: model-file
emptyDir: {}
{%- endif %}
3 changes: 3 additions & 0 deletions templates/http/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ commonLabels:
app.kubernetes.io/part-of: {{values.name}}
resources:
- initialize-namespace.yaml
{%- if values.vllmSelected %}
- pvc.yaml
{%- endif %}
- deployment.yaml
- route.yaml
- service.yaml
12 changes: 12 additions & 0 deletions templates/http/base/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: vllm-models-cache
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 100Gi