File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,11 @@ spec:
169169 requests :
170170 cpu : {{ .Values.resources.requests.cpu }}
171171 memory : {{ .Values.resources.requests.memory }}
172+ {{ if .Values.resources.requests }}
173+ {{ if .Values.resources.requests.nvidiaGpu }}
174+ nvidia.com/gpu : {{ .Values.resources.requests.nvidiaGpu }}
175+ {{ end }}
176+ {{ end }}
172177 limits :
173178 {{- if .Values.resources.setCPULimits }}
174179 {{- if .Values.resources.limits.cpu }}
@@ -182,6 +187,9 @@ spec:
182187 {{- else }}
183188 memory : {{ .Values.resources.requests.memory }}
184189 {{- end }}
190+ {{- if .Values.resources.limits.nvidiaGpu }}
191+ nvidia.com/gpu : {{ .Values.resources.limits.nvidiaGpu }}
192+ {{- end }}
185193 - name : sidecar
186194 image : ghcr.io/porter-dev/job_sidecar_container:31e471f4d
187195 imagePullPolicy : Always
@@ -262,6 +270,13 @@ spec:
262270 value : {{ $nodeGroup.id | quote }}
263271 effect : " NoSchedule"
264272 {{- end }}
273+ # nvidia.com/gpu toleration is automatically injected in EKS/GKE, but not in AKS
274+ # since we want to be cloud agnostic, we just add it ourselves wherever we need it
275+ {{- if .Values.resources.requests.nvidiaGpu}}
276+ - key : " nvidia.com/gpu"
277+ operator : " Exists"
278+ effect : " NoSchedule"
279+ {{- end }}
265280 backoffLimit : 0
266281 {{- if (.Values.sidecar.timeout) }}
267282 activeDeadlineSeconds : {{ .Values.sidecar.timeout }}
Original file line number Diff line number Diff line change @@ -462,6 +462,13 @@ spec:
462462 value : {{ $nodeGroup.id | quote }}
463463 effect : " NoSchedule"
464464 {{- end }}
465+ # nvidia.com/gpu toleration is automatically injected in EKS/GKE, but not in AKS
466+ # since we want to be cloud agnostic, we just add it ourselves wherever we need it
467+ {{- if .Values.resources.requests.nvidiaGpu}}
468+ - key : " nvidia.com/gpu"
469+ operator : " Exists"
470+ effect : " NoSchedule"
471+ {{- end }}
465472 {{- if .Values.topology.enabled }}
466473 topologySpreadConstraints :
467474 - maxSkew : {{ .Values.topology.maxSkew }}
Original file line number Diff line number Diff line change @@ -375,6 +375,13 @@ spec:
375375 value : {{ $nodeGroup.id | quote }}
376376 effect : " NoSchedule"
377377 {{- end }}
378+ # nvidia.com/gpu toleration is automatically injected in EKS/GKE, but not in AKS
379+ # since we want to be cloud agnostic, we just add it ourselves wherever we need it
380+ {{- if .Values.resources.requests.nvidiaGpu}}
381+ - key : " nvidia.com/gpu"
382+ operator : " Exists"
383+ effect : " NoSchedule"
384+ {{- end }}
378385 {{- if .Values.topology.enabled }}
379386 topologySpreadConstraints :
380387 - maxSkew : {{ .Values.topology.maxSkew }}
You can’t perform that action at this time.
0 commit comments