Skip to content

Commit

Permalink
Apply scheduling fields to cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
carmenlau committed Sep 28, 2022
2 parents 5c18548 + 684fb3d commit 7ec0127
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
38 changes: 38 additions & 0 deletions authgear/templates/analytic-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,25 @@ spec:
backoffLimit: 0
template:
spec:
{{- if .Values.authgear.portalServer.nodeSelector }}
nodeSelector:
{{- .Values.authgear.portalServer.nodeSelector | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.nodeName }}
nodeName: {{ .Values.authgear.portalServer.nodeName | quote }}
{{- end }}
{{- if .Values.authgear.portalServer.affinity }}
affinity:
{{- .Values.authgear.portalServer.affinity | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.tolerations }}
tolerations:
{{- .Values.authgear.portalServer.tolerations | toYaml | nindent 10 }}
{{- end }}
{{- if .Values.authgear.portalServer.topologySpreadConstraints }}
topologySpreadConstraints:
{{- .Values.authgear.portalServer.topologySpreadConstraints | toYaml | nindent 10 }}
{{- end }}
containers:
- name: authgear-analytic-cronjob-monthly
image: {{ .Values.authgear.portalServer.image | quote }}
Expand Down Expand Up @@ -181,6 +200,25 @@ spec:
backoffLimit: 0
template:
spec:
{{- if .Values.authgear.portalServer.nodeSelector }}
nodeSelector:
{{- .Values.authgear.portalServer.nodeSelector | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.nodeName }}
nodeName: {{ .Values.authgear.portalServer.nodeName | quote }}
{{- end }}
{{- if .Values.authgear.portalServer.affinity }}
affinity:
{{- .Values.authgear.portalServer.affinity | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.tolerations }}
tolerations:
{{- .Values.authgear.portalServer.tolerations | toYaml | nindent 10 }}
{{- end }}
{{- if .Values.authgear.portalServer.topologySpreadConstraints }}
topologySpreadConstraints:
{{- .Values.authgear.portalServer.topologySpreadConstraints | toYaml | nindent 10 }}
{{- end }}
containers:
- name: authgear-analytic-cronjob-daily
image: {{ .Values.authgear.portalServer.image | quote }}
Expand Down
19 changes: 19 additions & 0 deletions authgear/templates/audit-log-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ spec:
spec:
template:
spec:
{{- if .Values.authgear.mainServer.nodeSelector }}
nodeSelector:
{{- .Values.authgear.mainServer.nodeSelector | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.mainServer.nodeName }}
nodeName: {{ .Values.authgear.mainServer.nodeName | quote }}
{{- end }}
{{- if .Values.authgear.mainServer.affinity }}
affinity:
{{- .Values.authgear.mainServer.affinity | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.mainServer.tolerations }}
tolerations:
{{- .Values.authgear.mainServer.tolerations | toYaml | nindent 10 }}
{{- end }}
{{- if .Values.authgear.mainServer.topologySpreadConstraints }}
topologySpreadConstraints:
{{- .Values.authgear.mainServer.topologySpreadConstraints | toYaml | nindent 10 }}
{{- end }}
containers:
- name: authgear-audit-log-cronjob
image: {{ .Values.authgear.mainServer.image | quote }}
Expand Down
19 changes: 19 additions & 0 deletions authgear/templates/upload-stripe-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ spec:
template:
spec:
restartPolicy: Never
{{- if .Values.authgear.portalServer.nodeSelector }}
nodeSelector:
{{- .Values.authgear.portalServer.nodeSelector | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.nodeName }}
nodeName: {{ .Values.authgear.portalServer.nodeName | quote }}
{{- end }}
{{- if .Values.authgear.portalServer.affinity }}
affinity:
{{- .Values.authgear.portalServer.affinity | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.tolerations }}
tolerations:
{{- .Values.authgear.portalServer.tolerations | toYaml | nindent 10 }}
{{- end }}
{{- if .Values.authgear.portalServer.topologySpreadConstraints }}
topologySpreadConstraints:
{{- .Values.authgear.portalServer.topologySpreadConstraints | toYaml | nindent 10 }}
{{- end }}
containers:
- name: authgear-upload-stripe-cronjob
image: {{ .Values.authgear.portalServer.image | quote }}
Expand Down
19 changes: 19 additions & 0 deletions authgear/templates/usage-record-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ spec:
configMap:
defaultMode: 0755
name: {{ include "authgear.nameUsageRecordCron" . | quote }}
{{- if .Values.authgear.portalServer.nodeSelector }}
nodeSelector:
{{- .Values.authgear.portalServer.nodeSelector | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.nodeName }}
nodeName: {{ .Values.authgear.portalServer.nodeName | quote }}
{{- end }}
{{- if .Values.authgear.portalServer.affinity }}
affinity:
{{- .Values.authgear.portalServer.affinity | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.authgear.portalServer.tolerations }}
tolerations:
{{- .Values.authgear.portalServer.tolerations | toYaml | nindent 10 }}
{{- end }}
{{- if .Values.authgear.portalServer.topologySpreadConstraints }}
topologySpreadConstraints:
{{- .Values.authgear.portalServer.topologySpreadConstraints | toYaml | nindent 10 }}
{{- end }}
containers:
- name: authgear-usage-record-cronjob
image: {{ .Values.authgear.portalServer.image | quote }}
Expand Down

0 comments on commit 7ec0127

Please sign in to comment.