130 lines
3.6 KiB
YAML
130 lines
3.6 KiB
YAML
{{- $gpuRole := .Values.gpu.nodeRoleKey }}
|
|
{{- $tolKey := .Values.gpu.tolerationKey }}
|
|
{{- $tolVal := .Values.gpu.tolerationValue }}
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ .Chart.Name }}
|
|
labels:
|
|
app: {{ .Chart.Name }}
|
|
spec:
|
|
serviceName: {{ .Chart.Name }}
|
|
minReadySeconds: 10
|
|
updateStrategy:
|
|
type: RollingUpdate
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Chart.Name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ .Chart.Name }}
|
|
spec:
|
|
affinity:
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- podAffinityTerm:
|
|
labelSelector:
|
|
matchLabels:
|
|
app: {{ .Chart.Name }}
|
|
topologyKey: kubernetes.io/hostname
|
|
weight: 100
|
|
{{- if $gpuRole }}
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: {{ $gpuRole | quote }}
|
|
operator: Exists
|
|
{{- end }}
|
|
{{- if and $tolKey $tolVal }}
|
|
tolerations:
|
|
- key: {{ $tolKey | quote }}
|
|
operator: Equal
|
|
value: {{ $tolVal | quote }}
|
|
effect: NoExecute
|
|
{{- end }}
|
|
imagePullSecrets:
|
|
- name: registrysecret
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: {{ .Values.werf.image.vllm }}
|
|
imagePullPolicy: IfNotPresent
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /root/.cache/huggingface
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.port }}
|
|
protocol: TCP
|
|
args:
|
|
- {{ .Values.env.VLLM_MODEL }}
|
|
- --async-scheduling
|
|
- --host
|
|
- 0.0.0.0
|
|
- --port
|
|
- "{{ .Values.port }}"
|
|
- --gpu-memory-utilization
|
|
- "0.2"
|
|
- --max-model-len
|
|
- "{{ .Values.env.VLLM_MAX_MODEL_LEN }}"
|
|
- --enforce-eager
|
|
- --tensor-parallel-size
|
|
- "1"
|
|
- --trust-remote-code
|
|
- --chat-template-content-format
|
|
- "string"
|
|
env:
|
|
{{- range $n, $v := .Values.env }}
|
|
- name: {{ $n }}
|
|
value: {{ $v | quote }}
|
|
{{- end }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: {{ .Values.port }}
|
|
initialDelaySeconds: 120
|
|
periodSeconds: 9
|
|
timeoutSeconds: 6
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /v1/models
|
|
port: {{ .Values.port }}
|
|
initialDelaySeconds: 120
|
|
periodSeconds: 5
|
|
timeoutSeconds: 6
|
|
failureThreshold: 3
|
|
resources: {{ dig .Values.werf.env .Values.resources._default .Values.resources | toYaml | nindent 12 }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
storageClassName: {{ dig .Values.werf.env .Values.storage.class._default .Values.storage.class | quote }}
|
|
resources:
|
|
requests:
|
|
storage: {{ dig .Values.werf.env .Values.storage.size._default .Values.storage.size | quote }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ .Chart.Name }}
|
|
labels:
|
|
app: {{ .Chart.Name }}
|
|
prometheus.deckhouse.io/custom-target: {{ .Chart.Name }}
|
|
annotations:
|
|
prometheus.deckhouse.io/port: "{{ .Values.port }}"
|
|
prometheus.deckhouse.io/path: "/metrics/"
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: {{ .Values.port }}
|
|
targetPort: http
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app: {{ .Chart.Name }}
|