Add support for cronjob deployments

This commit is contained in:
Waqar Ahmed 2020-10-08 06:24:59 +05:00
parent 557d379c84
commit e174f013dc
2 changed files with 15 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# Workload type # Workload type
- variable: workloadType - variable: workloadType
description: "Please specify type of workload to deploy" description: "Please specify type of workload to deploy"
lablel: "Workload Type" label: "Workload Type"
schema: schema:
type: string type: string
default: "Deployment" default: "Deployment"
@ -11,6 +11,15 @@
- "Job" - "Job"
- "CronJob" - "CronJob"
# Cronjob schedule
- variable: cronSchedule
label: "Cron Schedule"
schema:
type: cron
show_if: [["workloadType", "=", "CronJob"]]
default:
minute: "5"
# Image related # Image related
- variable: image - variable: image
description: "Docker Image Details" description: "Docker Image Details"

View File

@ -12,7 +12,12 @@ spec:
matchLabels: matchLabels:
{{- include "ix-chart.selectorLabels" . | nindent 6 }} {{- include "ix-chart.selectorLabels" . | nindent 6 }}
{{- end }} {{- end }}
{{- if ne (include "workloadIsCronJob" .) "true" }}
template: template:
{{- else }}
schedule: {{ .Values.cronSchedule | quote }}
jobTemplate:
{{- end }}
metadata: metadata:
labels: labels:
{{- include "ix-chart.selectorLabels" . | nindent 8 }} {{- include "ix-chart.selectorLabels" . | nindent 8 }}