Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Durgpal | 7ad4069 | 2018-08-03 07:28:36 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 Amdocs,Bell Canada |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 16 | |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 18 | kind: Deployment |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 20 | spec: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
| 23 | template: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 25 | spec: |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 26 | {{ include "common.podSecurityContext" . | indent 6 | trim}} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 27 | initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }} |
| 28 | {{- if .Values.usePostgres }} |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 29 | - command: |
| 30 | - sh |
| 31 | args: |
| 32 | - -c |
| 33 | - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done" |
| 34 | env: |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 35 | - name: PG_USER |
| 36 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }} |
| 37 | - name: PG_PASSWORD |
| 38 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }} |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 39 | volumeMounts: |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 40 | - mountPath: /config-input |
| 41 | name: {{ include "common.name" . }}-config-input |
| 42 | - mountPath: /config |
| 43 | name: {{ include "common.name" . }}-config |
| 44 | name: {{ include "common.name" . }}-update-config |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 45 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 46 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 47 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 48 | - /app/ready.py |
dglFromAtt | fb58a9d | 2019-04-12 20:12:26 +0000 | [diff] [blame] | 49 | args: |
| 50 | - --container-name |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 51 | - {{ .Values.postgres.nameOverride }} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 52 | securityContext: |
| 53 | runAsUser: 100 |
| 54 | runAsGroup: 65533 |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 55 | env: |
| 56 | - name: NAMESPACE |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | apiVersion: v1 |
| 60 | fieldPath: metadata.namespace |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 61 | name: {{ include "common.name" . }}-postgres-readiness |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 62 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 63 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 64 | {{- end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 65 | containers: |
| 66 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 67 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 68 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 69 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 70 | {{ if eq .Values.liveness.enabled true -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 71 | livenessProbe: |
| 72 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 73 | port: {{ .Values.liveness.port }} |
| 74 | path: /webapi/topics |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 75 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
dglFromAtt | ec0918d | 2018-10-17 19:34:49 +0000 | [diff] [blame] | 76 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 77 | {{ end -}} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 78 | readinessProbe: |
| 79 | httpGet: |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 80 | port: {{ .Values.readiness.port }} |
| 81 | path: /webapi/topics |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 82 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 83 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 84 | volumeMounts: |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 85 | - mountPath: /etc/localtime |
| 86 | name: localtime |
| 87 | readOnly: true |
| 88 | - name: {{ include "common.name" . }}-config |
dglFromAtt | 8234007 | 2018-10-16 21:53:34 +0000 | [diff] [blame] | 89 | mountPath: /opt/app/config/conf/ |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 90 | - mountPath: /opt/app/dmaapbc/etc/logback.xml |
| 91 | name: {{ include "common.fullname" . }}-log-conf |
| 92 | subPath: logback.xml |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame^] | 93 | resources: {{ include "common.resources" . | nindent 12 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 94 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 95 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 96 | {{- end -}} |
| 97 | {{- if .Values.affinity }} |
Sylvain Desbureaux | 0de113e | 2020-03-10 09:57:25 +0100 | [diff] [blame] | 98 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 99 | {{- end }} |
farida azmy | 13388ba | 2021-03-17 11:33:28 +0200 | [diff] [blame] | 100 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 101 | volumes: |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 102 | - name: localtime |
| 103 | hostPath: |
| 104 | path: /etc/localtime |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 105 | - name: {{ include "common.fullname" . }}-log-conf |
| 106 | configMap: |
| 107 | name: {{ include "common.fullname" . }}-log |
| 108 | {{- if .Values.usePostgres }} |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 109 | - name: {{ include "common.name" . }}-config-input |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 110 | configMap: |
| 111 | name: {{ include "common.fullname" . }}-config |
Krzysztof Opasiak | 03a125a | 2020-05-05 02:11:09 +0200 | [diff] [blame] | 112 | - name: {{ include "common.name" . }}-config |
| 113 | emptyDir: |
| 114 | medium: Memory |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 115 | {{- else }} |
| 116 | - name: {{ include "common.name" . }}-config |
| 117 | configMap: |
| 118 | name: {{ include "common.fullname" . }}-config |
| 119 | {{- end }} |
Dominic Lunanuova | e825fee | 2018-04-12 14:40:34 +0000 | [diff] [blame] | 120 | imagePullSecrets: |
| 121 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |