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: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 37 | hostname: {{ .Values.global.dmaapDrProvName }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 38 | initContainers: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 39 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 40 | image: {{ include "repositoryGenerator.image.readiness" . }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 41 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 42 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 43 | - /app/ready.py |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 44 | args: |
| 45 | - --container-name |
| 46 | - {{ .Values.config.dmaapDrDb.mariadbContName }} |
| 47 | env: |
| 48 | - name: NAMESPACE |
| 49 | valueFrom: |
| 50 | fieldRef: |
| 51 | apiVersion: v1 |
| 52 | fieldPath: metadata.namespace |
| 53 | {{- if .Values.global.aafEnabled }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 54 | |
| 55 | {{ include "common.certInitializer.initContainer" . | nindent 8 }} |
| 56 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 57 | - name: {{ include "common.name" . }}-permission-fixer |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 58 | image: {{ include "repositoryGenerator.image.busybox" . }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 60 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 61 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 62 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 63 | {{ end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 64 | containers: |
| 65 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 66 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 67 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 68 | ports: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 69 | - containerPort: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 70 | {{- if eq .Values.liveness.enabled true }} |
| 71 | livenessProbe: |
| 72 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 73 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 74 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 75 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 76 | {{ end -}} |
| 77 | readinessProbe: |
| 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.readiness.initialDelaySeconds }} |
| 81 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Krzysztof Opasiak | e55b4d5 | 2020-02-07 22:54:20 +0100 | [diff] [blame] | 82 | env: |
| 83 | - name: DB_USERNAME |
Krzysztof Opasiak | b2c2383 | 2020-03-24 03:27:03 +0100 | [diff] [blame] | 84 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "login") | indent 12 }} |
Krzysztof Opasiak | e55b4d5 | 2020-02-07 22:54:20 +0100 | [diff] [blame] | 85 | - name: DB_PASSWORD |
Krzysztof Opasiak | b2c2383 | 2020-03-24 03:27:03 +0100 | [diff] [blame] | 86 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "password") | indent 12 }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 87 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 88 | - mountPath: /etc/localtime |
| 89 | name: localtime |
| 90 | readOnly: false |
| 91 | - mountPath: /opt/app/datartr/etc/provserver.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 92 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 93 | subPath: provserver.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 94 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 95 | name: {{ include "common.fullname" . }}-log-conf |
| 96 | subPath: logback.xml |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 97 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 98 | name: {{ include "common.fullname" . }}-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 99 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 100 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 101 | {{- if .Values.nodeSelector }} |
| 102 | nodeSelector: |
| 103 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 104 | {{- end -}} |
| 105 | {{- if .Values.affinity }} |
| 106 | affinity: |
| 107 | {{ toYaml .Values.affinity | indent 10 }} |
Sylvain Desbureaux | e615343 | 2021-02-04 18:26:23 +0100 | [diff] [blame] | 108 | {{- end }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 109 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 110 | - name: {{ include "common.name" . }}-filebeat-onap |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 111 | image: {{ include "repositoryGenerator.image.logging" . }} |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 112 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 113 | volumeMounts: |
| 114 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 115 | mountPath: /usr/share/filebeat/filebeat.yml |
| 116 | subPath: filebeat.yml |
| 117 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 118 | mountPath: /usr/share/filebeat/data |
| 119 | - name: {{ include "common.fullname" . }}-logs |
| 120 | mountPath: /var/log/onap/datarouter-prov |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 121 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 122 | - name: localtime |
| 123 | hostPath: |
| 124 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 125 | - name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 126 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 127 | name: {{ include "common.fullname" . }}-configmap |
| 128 | items: |
| 129 | - key: provserver.properties |
| 130 | path: provserver.properties |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 131 | - name: {{ include "common.fullname" . }}-log-conf |
| 132 | configMap: |
| 133 | name: {{ include "common.fullname" . }}-log |
| 134 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 135 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 136 | name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 137 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 138 | emptyDir: {} |
| 139 | - name: {{ include "common.fullname" . }}-logs |
| 140 | emptyDir: {} |
Sylvain Desbureaux | 435ef53 | 2018-12-20 10:58:09 +0100 | [diff] [blame] | 141 | imagePullSecrets: |
| 142 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |