Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
| 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 | */}} |
Grzegorz-Lis | b1da772 | 2020-07-23 09:32:48 +0200 | [diff] [blame] | 16 | apiVersion: apps/v1 |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }} |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }} |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
Grzegorz-Lis | b1da772 | 2020-07-23 09:32:48 +0200 | [diff] [blame] | 27 | selector: |
| 28 | matchLabels: |
| 29 | app: {{ include "common.name" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 30 | replicas: {{ .Values.replicaCount }} |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 35 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 36 | spec: |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 37 | {{ include "common.podSecurityContext" . | indent 6 | trim}} |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 38 | hostname: {{ .Values.global.dmaapDrProvName }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 39 | initContainers: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 40 | - name: {{ include "common.name" . }}-readiness |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 41 | securityContext: |
| 42 | runAsUser: 100 |
| 43 | runAsGroup: 65533 |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 44 | image: {{ include "repositoryGenerator.image.readiness" . }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 45 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 46 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 47 | - /app/ready.py |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 48 | args: |
Mahmoud Abdelhamid | 7fc530c | 2021-09-15 20:27:19 +0200 | [diff] [blame] | 49 | - --job-name |
| 50 | - {{ include "common.release" . }}-dmaap-dr-mariadb-init-config-job |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 51 | env: |
| 52 | - name: NAMESPACE |
| 53 | valueFrom: |
| 54 | fieldRef: |
| 55 | apiVersion: v1 |
| 56 | fieldPath: metadata.namespace |
| 57 | {{- if .Values.global.aafEnabled }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 58 | |
| 59 | {{ include "common.certInitializer.initContainer" . | nindent 8 }} |
| 60 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 61 | - name: {{ include "common.name" . }}-permission-fixer |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 62 | securityContext: |
| 63 | runAsUser: 0 |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 64 | image: {{ include "repositoryGenerator.image.busybox" . }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 66 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 67 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 68 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 69 | {{ end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 70 | containers: |
| 71 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 72 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 73 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 74 | ports: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 75 | - containerPort: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 76 | {{- if eq .Values.liveness.enabled true }} |
| 77 | livenessProbe: |
| 78 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 79 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 80 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 82 | {{ end -}} |
| 83 | readinessProbe: |
| 84 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 85 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 86 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 87 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Krzysztof Opasiak | e55b4d5 | 2020-02-07 22:54:20 +0100 | [diff] [blame] | 88 | env: |
| 89 | - name: DB_USERNAME |
Mahmoud Abdelhamid | 7fc530c | 2021-09-15 20:27:19 +0200 | [diff] [blame] | 90 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-credentials" "key" "login") | indent 12 }} |
Krzysztof Opasiak | e55b4d5 | 2020-02-07 22:54:20 +0100 | [diff] [blame] | 91 | - name: DB_PASSWORD |
Mahmoud Abdelhamid | 7fc530c | 2021-09-15 20:27:19 +0200 | [diff] [blame] | 92 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-credentials" "key" "password") | indent 12 }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 93 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 94 | - mountPath: /etc/localtime |
| 95 | name: localtime |
| 96 | readOnly: false |
| 97 | - mountPath: /opt/app/datartr/etc/provserver.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 98 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 99 | subPath: provserver.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 100 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 101 | name: {{ include "common.fullname" . }}-log-conf |
| 102 | subPath: logback.xml |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 103 | - mountPath: {{ .Values.global.loggingDirectory }} |
Maciej Wereski | 128e9d2 | 2022-01-10 11:03:27 +0100 | [diff] [blame] | 104 | name: logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 105 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 106 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 107 | {{- if .Values.nodeSelector }} |
| 108 | nodeSelector: |
| 109 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 110 | {{- end -}} |
| 111 | {{- if .Values.affinity }} |
| 112 | affinity: |
| 113 | {{ toYaml .Values.affinity | indent 10 }} |
Sylvain Desbureaux | e615343 | 2021-02-04 18:26:23 +0100 | [diff] [blame] | 114 | {{- end }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 115 | # Filebeat sidecar container |
Maciej Wereski | 9075b5c | 2021-11-04 14:01:26 +0000 | [diff] [blame] | 116 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | 13388ba | 2021-03-17 11:33:28 +0200 | [diff] [blame] | 117 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 118 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 119 | - name: localtime |
| 120 | hostPath: |
| 121 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 122 | - name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 123 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 124 | name: {{ include "common.fullname" . }}-configmap |
| 125 | items: |
| 126 | - key: provserver.properties |
| 127 | path: provserver.properties |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 128 | - name: {{ include "common.fullname" . }}-log-conf |
| 129 | configMap: |
| 130 | name: {{ include "common.fullname" . }}-log |
Maciej Wereski | 9075b5c | 2021-11-04 14:01:26 +0000 | [diff] [blame] | 131 | {{ include "common.log.volumes" . | nindent 6 }} |
Maciej Wereski | 128e9d2 | 2022-01-10 11:03:27 +0100 | [diff] [blame] | 132 | - name: logs |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 133 | emptyDir: {} |
Sylvain Desbureaux | 435ef53 | 2018-12-20 10:58:09 +0100 | [diff] [blame] | 134 | imagePullSecrets: |
| 135 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |