Skip to content

Commit

Permalink
[EPMDEDP-7188]: Fix toleration/affinity/node selector
Browse files Browse the repository at this point in the history
Change-Id: Ibc42e1a1af86dec631c514b5133279fda3782586
(cherry picked from commit 11e0ba3)
  • Loading branch information
SergK authored and MykolaMarusenko committed Sep 10, 2021
1 parent 7a2e39c commit 7c7482b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
24 changes: 12 additions & 12 deletions deploy-templates/templates/db/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ spec:
labels:
app: {{.Values.global.database.name}}
spec:
{{- with .Values.global.database.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.database.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.database.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- env:
- name: POSTGRES_USER
Expand Down Expand Up @@ -76,18 +88,6 @@ spec:
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: {{.Values.global.database.name}}
{{- with .Values.global.database.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.database.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.database.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
runAsUser: 999
runAsNonRoot: true
Expand Down
12 changes: 12 additions & 0 deletions deploy-templates/templates/init_db_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ spec:
app: {{.Values.global.database.name}}
spec:
restartPolicy: Never
{{- with .Values.global.database.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.database.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.database.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- image: {{.Values.global.database.image}}
name: db-init
Expand Down

0 comments on commit 7c7482b

Please sign in to comment.