Add gpu resource to workload if requested

This commit is contained in:
Waqar Ahmed 2020-10-16 21:42:36 +05:00
parent 5f85618cd0
commit 34fb0ce218
2 changed files with 22 additions and 0 deletions

View File

@ -17,6 +17,8 @@ groups:
description: "Configure how pods are replaced when configuration is upgraded" description: "Configure how pods are replaced when configuration is upgraded"
- name: "Restart Policy" - name: "Restart Policy"
description: "Configure when pod should be restarted in case of failure" description: "Configure when pod should be restarted in case of failure"
- name: "Resource Reservation"
description: "Specify resources to be allocated to workload"
questions: questions:
# Workload type # Workload type
@ -395,3 +397,12 @@ questions:
schema: schema:
type: int type: int
default: 10 default: 10
# Specify GPU configuration
- variable: gpuConfiguration
label: "GPU Configuration"
group: "Resource Reservation"
schema:
type: dict
$ref:
- "definitions/gpuConfiguration"

View File

@ -60,3 +60,14 @@ ports:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Container Resource Configuration
*/}}
{{- define "containerResourceConfiguration" }}
{{- if .Values.gpuConfiguration }}
resources:
limits:
{{- toYaml .Values.gpuConfiguration | nindent 4 }}
{{- end }}
{{- end }}