From fbeef979a78eaf9649cd55ec70eed1050382b8e2 Mon Sep 17 00:00:00 2001 From: Maxim Omelchenko Date: Mon, 3 Jun 2024 15:19:42 +0300 Subject: [PATCH] feat: cronjob fix USAWS-56 --- application/templates/cronjob.yaml | 39 ++++++++++++++---------------- application/values-test.yaml | 1 + application/values.yaml | 7 +++--- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/application/templates/cronjob.yaml b/application/templates/cronjob.yaml index 17769d89..1392f527 100644 --- a/application/templates/cronjob.yaml +++ b/application/templates/cronjob.yaml @@ -64,68 +64,65 @@ spec: image: {{ $image }} {{- if $job.image.imagePullPolicy }} imagePullPolicy: {{ $job.image.imagePullPolicy }} - {{- end }} + {{ end }} {{- with $job.env }} env: {{- range $key, $value := $job.env }} - name: {{ include "application.tplvalues.render" ( dict "value" $key "context" $ ) }} - {{- include "application.tplvalues.render" ( dict "value" $value "context" $ ) | indent 14 }} +{{ include "application.tplvalues.render" ( dict "value" $value "context" $ ) | indent 14 }} {{- end }} {{- end }} {{- with $job.envFrom }} envFrom: - {{- toYaml . | indent 14 }} +{{ toYaml . | indent 12 }} {{- end }} {{- if $job.command }} command: {{ $job.command }} {{- end }} {{- with $job.args }} args: - {{- toYaml . | indent 14 }} +{{ toYaml . | indent 12 }} {{- end }} {{- with $job.resources }} resources: - {{- toYaml . | indent 14 }} +{{ toYaml . | indent 14 }} {{- end }} {{- with $job.volumeMounts }} volumeMounts: - {{- toYaml . | indent 14 }} +{{ toYaml . | indent 12 }} {{- end }} {{- with $job.nodeSelector }} nodeSelector: - {{- toYaml . | indent 12 }} +{{ toYaml . | indent 12 }} {{- end }} {{- with $job.affinity }} affinity: - {{- toYaml . | indent 12 }} +{{ toYaml . | indent 12 }} {{- end }} {{- with $job.priorityClassName }} priorityClassName: {{ . }} {{- end }} {{- with $job.tolerations }} - tolerations: - {{- toYaml . | nindent 12 }} + tolerations: {{ toYaml . | nindent 12 }} {{- end }} {{- with $job.topologySpreadConstraints }} - topologySpreadConstraints: - {{- toYaml . | nindent 12 }} + topologySpreadConstraints: {{ toYaml . | nindent 12 }} {{- end }} {{- with $job.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} + securityContext: {{ toYaml . | nindent 12 }} {{- end }} - {{- if $job.restartPolicy}} + {{- if $job.restartPolicy }} restartPolicy: {{ $job.restartPolicy }} - {{- else }} + {{ else }} restartPolicy: OnFailure - {{- end }} - {{- with $job.imagePullSecrets}} + {{ end }} + {{- with $job.imagePullSecrets }} imagePullSecrets: - {{- toYaml . | indent 12 }} - {{- end }} +{{ toYaml . | indent 12 }} + {{ end }} {{- with $job.volumes }} volumes: - {{- toYaml . | indent 12 }} +{{ toYaml . | indent 12 }} {{- end }} {{- end }} {{- end }} diff --git a/application/values-test.yaml b/application/values-test.yaml index e62b4b5e..3bc2aea5 100644 --- a/application/values-test.yaml +++ b/application/values-test.yaml @@ -1298,6 +1298,7 @@ cronJob: jobs: db-migration: schedule: "* * * 8 *" + priorityClassName: high-priority imagePullSecrets: - name: nexus-secret image: diff --git a/application/values.yaml b/application/values.yaml index 2e47682b..586aa6d4 100644 --- a/application/values.yaml +++ b/application/values.yaml @@ -24,6 +24,7 @@ cronJob: jobs: # db-migration: # schedule: "* * * 8 *" + # priorityClassName: high-priority # env: # KEY: # value: VALUE @@ -149,7 +150,7 @@ deployment: # mountPath: path-2 # priorityClassName defines the priority class for pod scheduling - priorityClassName: + priorityClassName: '' # Taint tolerations for nodes tolerations: @@ -523,9 +524,9 @@ rbac: ########################################################## configMap: enabled: false - additionalLabels: + additionalLabels: # key: value - annotations: + annotations: # key: value files: # nameSuffix of configMap