Skip to content

Commit

Permalink
feat: cronjob fix USAWS-56
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Omelchenko committed Jun 3, 2024
1 parent 8bdf177 commit fbeef97
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
39 changes: 18 additions & 21 deletions application/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions application/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ cronJob:
jobs:
db-migration:
schedule: "* * * 8 *"
priorityClassName: high-priority
imagePullSecrets:
- name: nexus-secret
image:
Expand Down
7 changes: 4 additions & 3 deletions application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cronJob:
jobs:
# db-migration:
# schedule: "* * * 8 *"
# priorityClassName: high-priority
# env:
# KEY:
# value: VALUE
Expand Down Expand Up @@ -149,7 +150,7 @@ deployment:
# mountPath: path-2

# priorityClassName defines the priority class for pod scheduling
priorityClassName:
priorityClassName: ''

# Taint tolerations for nodes
tolerations:
Expand Down Expand Up @@ -523,9 +524,9 @@ rbac:
##########################################################
configMap:
enabled: false
additionalLabels:
additionalLabels:
# key: value
annotations:
annotations:
# key: value
files:
# nameSuffix of configMap
Expand Down

0 comments on commit fbeef97

Please sign in to comment.