From 73e0b275ccaf5e95b0ad89c118bb78ac431038cf Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Thu, 8 Oct 2020 00:50:50 +0500 Subject: [PATCH] Add initial support for job type workloads --- charts/ix-chart/2009.0.1/questions.yaml | 14 ++++++++++++++ charts/ix-chart/2009.0.1/templates/deployment.yaml | 4 +++- charts/ix-chart/2009.0.1/values.yaml | 4 ---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/charts/ix-chart/2009.0.1/questions.yaml b/charts/ix-chart/2009.0.1/questions.yaml index 55ef427359a..dcf5f59ee66 100644 --- a/charts/ix-chart/2009.0.1/questions.yaml +++ b/charts/ix-chart/2009.0.1/questions.yaml @@ -1,3 +1,16 @@ +# Workload type +- variable: workloadType + description: "Please specify type of workload to deploy" + lablel: "Workload Type" + schema: + type: string + default: "Deployment" + required: true + enum: + - "Deployment" + - "Job" + - "CronJob" + # Image related - variable: image description: "Docker Image Details" @@ -38,6 +51,7 @@ label: "Update Strategy" schema: type: string + show_if: [["workloadType", "=", "Deployment"]] default: "RollingUpdate" enum: - "RollingUpdate" diff --git a/charts/ix-chart/2009.0.1/templates/deployment.yaml b/charts/ix-chart/2009.0.1/templates/deployment.yaml index 66e4be693ec..2c97addd3a4 100644 --- a/charts/ix-chart/2009.0.1/templates/deployment.yaml +++ b/charts/ix-chart/2009.0.1/templates/deployment.yaml @@ -1,12 +1,14 @@ apiVersion: apps/v1 -kind: Deployment +kind: {{ .Values.workloadType }} metadata: name: {{ include "ix-chart.fullname" . }} labels: {{- include "ix-chart.labels" . | nindent 4 }} spec: + {{- if eq .Values.workloadType "Deployment" }} strategy: type: {{ .Values.updateStrategy }} + {{- end }} selector: matchLabels: {{- include "ix-chart.selectorLabels" . | nindent 6 }} diff --git a/charts/ix-chart/2009.0.1/values.yaml b/charts/ix-chart/2009.0.1/values.yaml index ec3aa098001..1174db8a09b 100644 --- a/charts/ix-chart/2009.0.1/values.yaml +++ b/charts/ix-chart/2009.0.1/values.yaml @@ -6,10 +6,6 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "testing" - -# Update strategy -updateStrategy: "RollingUpdate" - # Restart Policy restartPolicy: "Always"