Skip to content

Commit 600afe6

Browse files
authored
Added parallelism field in cronjob chart (#1517)
* added parallelism in cronjob chart * added parallelism value in app-values.yaml * added field to different spec location * fixed extra spacing * fix again * added apiVersion check * added apiVersion check * resolved apiVersion * resolve apiVersion on 1.3.0 * condition change * condition change
1 parent 58976fb commit 600afe6

4 files changed

Lines changed: 21 additions & 13 deletions

File tree

scripts/devtron-reference-helm-charts/cronjob-chart_1-2-0/app-values.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ jobConfigs:
88
completions: 2
99
suspend: false
1010
ttlSecondsAfterFinished: 100
11-
11+
1212
cronjobConfigs:
1313
schedule: "* * * * *"
1414
startingDeadlineSeconds: 100
15+
parallelism: 1
1516
concurrencyPolicy: Allow
1617
suspend: false
1718
successfulJobsHistoryLimit: 3
@@ -59,14 +60,13 @@ resources:
5960
cpu: 0.10
6061
memory: 100Mi
6162

62-
6363
# Optional configs
6464

6565
command:
6666
enabled: false
6767
value: []
68-
69-
args:
68+
69+
args:
7070
enabled: false
7171
value:
7272
- /bin/sh
@@ -110,7 +110,6 @@ volumes: []
110110
# - name: log-volume
111111
# emptyDir: {}
112112

113-
114113
tolerations: []
115114

116115
Spec:
@@ -140,4 +139,4 @@ containerSecurityContext:
140139
podSecurityContext: {}
141140
# runAsUser: 1000
142141
# runAsGroup: 3000
143-
# fsGroup: 2000
142+
# fsGroup: 2000

scripts/devtron-reference-helm-charts/cronjob-chart_1-2-0/templates/Cronjob.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
{{- end }}
2626

2727
{{ if eq .Values.kind "CronJob" }}
28+
{{ if semverCompare "<1.21" .Capabilities.KubeVersion.GitVersion -}}
29+
apiVersion: batch/v1beta1
30+
{{- else }}
2831
apiVersion: batch/v1
32+
{{- end }}
2933
kind: CronJob
3034
metadata:
3135
name: {{ include ".Chart.Name .fullname" $ }}
@@ -63,6 +67,7 @@ spec:
6367
{{- end }}
6468
spec:
6569
terminationGracePeriodSeconds: {{ $.Values.GracePeriod }}
70+
parallelism: {{ $.Values.cronjobConfigs.parallelism }}
6671
restartPolicy: {{ $.Values.cronjobConfigs.restartPolicy }}
6772
{{- if and $.Values.Spec.Affinity.Key $.Values.Spec.Affinity.Values }}
6873
affinity:

scripts/devtron-reference-helm-charts/cronjob-chart_1-3-0/app-values.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ jobConfigs:
88
completions: 2
99
suspend: false
1010
ttlSecondsAfterFinished: 100
11-
11+
1212
cronjobConfigs:
1313
schedule: "* * * * *"
1414
startingDeadlineSeconds: 100
15+
parallelism: 1
1516
concurrencyPolicy: Allow
1617
suspend: false
1718
successfulJobsHistoryLimit: 3
@@ -59,14 +60,13 @@ resources:
5960
cpu: 0.10
6061
memory: 100Mi
6162

62-
6363
# Optional configs
6464

6565
command:
6666
enabled: false
6767
value: []
68-
69-
args:
68+
69+
args:
7070
enabled: false
7171
value:
7272
- /bin/sh
@@ -110,7 +110,6 @@ volumes: []
110110
# - name: log-volume
111111
# emptyDir: {}
112112

113-
114113
tolerations: []
115114

116115
Spec:
@@ -140,6 +139,6 @@ containerSecurityContext:
140139
podSecurityContext: {}
141140
# runAsUser: 1000
142141
# runAsGroup: 3000
143-
# fsGroup: 2000
142+
# fsGroup: 2000
144143

145-
shareProcessNamespace: false
144+
shareProcessNamespace: false

scripts/devtron-reference-helm-charts/cronjob-chart_1-3-0/templates/cronjob.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
{{- end }}
2626

2727
{{ if eq .Values.kind "CronJob" }}
28+
{{ if semverCompare "<1.21" .Capabilities.KubeVersion.GitVersion -}}
29+
apiVersion: batch/v1beta1
30+
{{- else }}
2831
apiVersion: batch/v1
32+
{{- end }}
2933
kind: CronJob
3034
metadata:
3135
name: {{ include ".Chart.Name .fullname" $ }}
@@ -64,6 +68,7 @@ spec:
6468
spec:
6569
shareProcessNamespace: {{ $.Values.shareProcessNamespace }}
6670
terminationGracePeriodSeconds: {{ $.Values.GracePeriod }}
71+
parallelism: {{ $.Values.cronjobConfigs.parallelism }}
6772
restartPolicy: {{ $.Values.cronjobConfigs.restartPolicy }}
6873
{{- if and $.Values.Spec.Affinity.Key $.Values.Spec.Affinity.Values }}
6974
affinity:

0 commit comments

Comments
 (0)