|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ template "common.names.fullname" . }} |
| 5 | + namespace: {{ include "common.names.namespace" . | quote }} |
| 6 | + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 7 | + app.kubernetes.io/component: vllm |
| 8 | + {{- if .Values.commonAnnotations }} |
| 9 | + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 10 | + {{- end }} |
| 11 | +spec: |
| 12 | + {{- if not .Values.autoscaling.hpa.enabled }} |
| 13 | + replicas: {{ .Values.replicaCount }} |
| 14 | + {{- end }} |
| 15 | + |
| 16 | + {{- if .Values.updateStrategy }} |
| 17 | + strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} |
| 18 | + {{- end }} |
| 19 | + |
| 20 | + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} |
| 21 | + |
| 22 | + selector: |
| 23 | + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} |
| 24 | + app.kubernetes.io/component: vllm |
| 25 | + |
| 26 | + template: |
| 27 | + metadata: |
| 28 | + {{- if .Values.podAnnotations }} |
| 29 | + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} |
| 32 | + app.kubernetes.io/component: vllm |
| 33 | + |
| 34 | + spec: |
| 35 | + {{- include "vllm.imagePullSecrets" . | nindent 6 }} |
| 36 | + |
| 37 | + serviceAccountName: {{ template "vllm.serviceAccountName" . }} |
| 38 | + |
| 39 | + {{- if .Values.affinity }} |
| 40 | + affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} |
| 41 | + {{- else }} |
| 42 | + affinity: |
| 43 | + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "customLabels" $podLabels "context" $) | nindent 10 }} |
| 44 | + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "customLabels" $podLabels "context" $) | nindent 10 }} |
| 45 | + nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} |
| 46 | + {{- end }} |
| 47 | + |
| 48 | + {{- if .Values.nodeSelector }} |
| 49 | + nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} |
| 50 | + {{- end }} |
| 51 | + |
| 52 | + {{- if .Values.tolerations }} |
| 53 | + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} |
| 54 | + {{- end }} |
| 55 | + |
| 56 | + priorityClassName: {{ .Values.priorityClassName | quote }} |
| 57 | + |
| 58 | + {{- if .Values.schedulerName }} |
| 59 | + schedulerName: {{ .Values.schedulerName }} |
| 60 | + {{- end }} |
| 61 | + |
| 62 | + {{- if .Values.topologySpreadConstraints }} |
| 63 | + topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} |
| 64 | + {{- end }} |
| 65 | + |
| 66 | + {{- if .Values.podSecurityContext.enabled }} |
| 67 | + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} |
| 68 | + {{- end }} |
| 69 | + |
| 70 | + {{- if .Values.terminationGracePeriodSeconds }} |
| 71 | + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} |
| 72 | + {{- end }} |
| 73 | + |
| 74 | + {{- if .Values.initContainers }} |
| 75 | + initContainers: |
| 76 | + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} |
| 77 | + {{- end }} |
| 78 | + |
| 79 | + containers: |
| 80 | + - name: {{ .Chart.Name }} |
| 81 | + image: {{ template "vllm.image" . }} |
| 82 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 83 | + {{- if .Values.containerSecurityContext.enabled }} |
| 84 | + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) | nindent 12 }} |
| 85 | + {{- end }} |
| 86 | + |
| 87 | + {{- if .Values.diagnosticMode.enabled }} |
| 88 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} |
| 89 | + {{- else if .Values.command }} |
| 90 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} |
| 91 | + {{- end }} |
| 92 | + {{- if .Values.diagnosticMode.enabled }} |
| 93 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} |
| 94 | + {{- else if .Values.args }} |
| 95 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} |
| 96 | + {{- end }} |
| 97 | + |
| 98 | + env: |
| 99 | + - name: "IMAGE_NAME" |
| 100 | + value: "{{ template "vllm.image" . }}" |
| 101 | + - name: "VLLM_PORT" |
| 102 | + value: "{{ .Values.containerPorts.httppublic }}" |
| 103 | + {{- if .Values.extraEnvVars }} |
| 104 | + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} |
| 105 | + {{- end }} |
| 106 | + envFrom: |
| 107 | + {{- if .Values.extraEnvVarsCM }} |
| 108 | + - configMapRef: |
| 109 | + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }} |
| 110 | + {{- end }} |
| 111 | + {{- if .Values.extraEnvVarsSecret }} |
| 112 | + - secretRef: |
| 113 | + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} |
| 114 | + {{- end }} |
| 115 | + |
| 116 | + {{- if .Values.resources }} |
| 117 | + resources: {{- toYaml .Values.resources | nindent 12 }} |
| 118 | + {{- else if ne .Values.resourcesPreset "none" }} |
| 119 | + resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }} |
| 120 | + {{- end }} |
| 121 | + |
| 122 | + ports: |
| 123 | + - name: httppublic |
| 124 | + containerPort: {{ .Values.containerPorts.httppublic }} |
| 125 | + {{- if .Values.extraContainerPorts }} |
| 126 | + {{- include "common.tplvalues.render" (dict "value" .Values.extraContainerPorts "context" $) | nindent 12 }} |
| 127 | + {{- end }} |
| 128 | + |
| 129 | + {{- if not .Values.diagnosticMode.enabled }} |
| 130 | + {{- if .Values.customLivenessProbe }} |
| 131 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} |
| 132 | + {{- else if .Values.livenessProbe.enabled }} |
| 133 | + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} |
| 134 | + {{- end }} |
| 135 | + {{- if .Values.customReadinessProbe }} |
| 136 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} |
| 137 | + {{- else if .Values.readinessProbe.enabled }} |
| 138 | + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} |
| 139 | + {{- end }} |
| 140 | + {{- if .Values.customStartupProbe }} |
| 141 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} |
| 142 | + {{- else if .Values.startupProbe.enabled }} |
| 143 | + startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} |
| 144 | + {{- end }} |
| 145 | + {{- end }} |
| 146 | + |
| 147 | + {{- if .Values.lifecycleHooks }} |
| 148 | + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} |
| 149 | + {{- end }} |
| 150 | + |
| 151 | + volumeMounts: |
| 152 | + {{- range $k, $v := index .Values "app-configuration" }} |
| 153 | + - name: appsettings |
| 154 | + readOnly: true |
| 155 | + mountPath: "/app/vllm/{{ $k }}" |
| 156 | + subPath: {{ $k }} |
| 157 | + {{- end }} |
| 158 | + - name: empty-dir |
| 159 | + mountPath: /tmp |
| 160 | + subPath: tmp-dir |
| 161 | + - name: data |
| 162 | + mountPath: {{ .Values.persistence.mountPath }} |
| 163 | + {{- if .Values.persistence.subPath }} |
| 164 | + subPath: {{ .Values.persistence.subPath }} |
| 165 | + {{- end }} |
| 166 | + {{- if .Values.extraVolumeMounts }} |
| 167 | + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} |
| 168 | + {{- end }} |
| 169 | + {{- if .Values.sidecars }} |
| 170 | + {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} |
| 171 | + {{- end }} |
| 172 | + |
| 173 | + volumes: |
| 174 | + - name: empty-dir |
| 175 | + emptyDir: { } |
| 176 | + - name: data |
| 177 | + {{- if .Values.persistence.enabled }} |
| 178 | + persistentVolumeClaim: |
| 179 | + claimName: {{ default (include "common.names.fullname" .) .Values.persistence.existingClaim }} |
| 180 | + {{- else }} |
| 181 | + emptyDir: {} |
| 182 | + {{- end }} |
| 183 | + - name: appsettings |
| 184 | + secret: |
| 185 | + secretName: {{ template "common.names.fullname" . }}-app-configuration |
| 186 | + {{- if .Values.extraVolumes }} |
| 187 | + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }} |
| 188 | + {{- end }} |
0 commit comments