From 34fb0ce2188b2e9801aa99a1eb1f6420873bfbb2 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Fri, 16 Oct 2020 21:42:36 +0500 Subject: [PATCH] Add gpu resource to workload if requested --- charts/ix-chart/2010.0.1/questions.yaml | 11 +++++++++++ charts/ix-chart/2010.0.1/templates/_containers.tpl | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/charts/ix-chart/2010.0.1/questions.yaml b/charts/ix-chart/2010.0.1/questions.yaml index 4b0d352369f..179763b5e79 100644 --- a/charts/ix-chart/2010.0.1/questions.yaml +++ b/charts/ix-chart/2010.0.1/questions.yaml @@ -17,6 +17,8 @@ groups: description: "Configure how pods are replaced when configuration is upgraded" - name: "Restart Policy" description: "Configure when pod should be restarted in case of failure" + - name: "Resource Reservation" + description: "Specify resources to be allocated to workload" questions: # Workload type @@ -395,3 +397,12 @@ questions: schema: type: int default: 10 + + # Specify GPU configuration + - variable: gpuConfiguration + label: "GPU Configuration" + group: "Resource Reservation" + schema: + type: dict + $ref: + - "definitions/gpuConfiguration" diff --git a/charts/ix-chart/2010.0.1/templates/_containers.tpl b/charts/ix-chart/2010.0.1/templates/_containers.tpl index 23b103dbab0..854bba27331 100644 --- a/charts/ix-chart/2010.0.1/templates/_containers.tpl +++ b/charts/ix-chart/2010.0.1/templates/_containers.tpl @@ -60,3 +60,14 @@ ports: {{- end }} {{- end }} {{- end }} + +{{/* +Container Resource Configuration +*/}} +{{- define "containerResourceConfiguration" }} +{{- if .Values.gpuConfiguration }} +resources: + limits: + {{- toYaml .Values.gpuConfiguration | nindent 4 }} +{{- end }} +{{- end }}