Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Grzegorz-Lis | b1da772 | 2020-07-23 09:32:48 +0200 | [diff] [blame] | 14 | apiVersion: apps/v1 |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 15 | kind: Deployment |
| 16 | metadata: |
| 17 | name: {{ include "common.fullname" . }} |
| 18 | namespace: {{ include "common.namespace" . }} |
| 19 | labels: |
| 20 | app: {{ include "common.name" . }} |
| 21 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 22 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 23 | heritage: {{ .Release.Service }} |
| 24 | spec: |
Grzegorz-Lis | b1da772 | 2020-07-23 09:32:48 +0200 | [diff] [blame] | 25 | selector: |
| 26 | matchLabels: |
| 27 | app: {{ include "common.name" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 28 | replicas: {{ .Values.replicaCount }} |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 33 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 34 | spec: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 35 | hostname: {{ .Values.global.dmaapDrProvName }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 36 | initContainers: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 37 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 38 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 39 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 40 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 41 | - /app/ready.py |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 42 | args: |
| 43 | - --container-name |
| 44 | - {{ .Values.config.dmaapDrDb.mariadbContName }} |
| 45 | env: |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
| 51 | {{- if .Values.global.aafEnabled }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 52 | |
| 53 | {{ include "common.certInitializer.initContainer" . | nindent 8 }} |
| 54 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 55 | - name: {{ include "common.name" . }}-permission-fixer |
| 56 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 57 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 58 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 59 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 60 | |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 61 | {{ end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 62 | containers: |
| 63 | - name: {{ include "common.name" . }} |
| 64 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 66 | ports: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 67 | - containerPort: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 68 | {{- if eq .Values.liveness.enabled true }} |
| 69 | livenessProbe: |
| 70 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 71 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 72 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 73 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 74 | {{ end -}} |
| 75 | readinessProbe: |
| 76 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 77 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 78 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Krzysztof Opasiak | e55b4d5 | 2020-02-07 22:54:20 +0100 | [diff] [blame] | 80 | env: |
| 81 | - name: DB_USERNAME |
Krzysztof Opasiak | b2c2383 | 2020-03-24 03:27:03 +0100 | [diff] [blame] | 82 | {{- 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] | 83 | - name: DB_PASSWORD |
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" "password") | indent 12 }} |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 85 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 86 | - mountPath: /etc/localtime |
| 87 | name: localtime |
| 88 | readOnly: false |
| 89 | - mountPath: /opt/app/datartr/etc/provserver.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 90 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 91 | subPath: provserver.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 92 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 93 | name: {{ include "common.fullname" . }}-log-conf |
| 94 | subPath: logback.xml |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 95 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 96 | name: {{ include "common.fullname" . }}-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 97 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 98 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 99 | {{- if .Values.nodeSelector }} |
| 100 | nodeSelector: |
| 101 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 102 | {{- end -}} |
| 103 | {{- if .Values.affinity }} |
| 104 | affinity: |
| 105 | {{ toYaml .Values.affinity | indent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 106 | {{- end -}} |
| 107 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 108 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 109 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 110 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 111 | volumeMounts: |
| 112 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 113 | mountPath: /usr/share/filebeat/filebeat.yml |
| 114 | subPath: filebeat.yml |
| 115 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 116 | mountPath: /usr/share/filebeat/data |
| 117 | - name: {{ include "common.fullname" . }}-logs |
| 118 | mountPath: /var/log/onap/datarouter-prov |
Krzysztof Opasiak | 2df4a78 | 2020-05-08 22:50:24 +0200 | [diff] [blame] | 119 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 120 | - name: localtime |
| 121 | hostPath: |
| 122 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 123 | - name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 124 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 125 | name: {{ include "common.fullname" . }}-configmap |
| 126 | items: |
| 127 | - key: provserver.properties |
| 128 | path: provserver.properties |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 129 | - name: {{ include "common.fullname" . }}-log-conf |
| 130 | configMap: |
| 131 | name: {{ include "common.fullname" . }}-log |
| 132 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 133 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 134 | name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 135 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 136 | emptyDir: {} |
| 137 | - name: {{ include "common.fullname" . }}-logs |
| 138 | emptyDir: {} |
Sylvain Desbureaux | 435ef53 | 2018-12-20 10:58:09 +0100 | [diff] [blame] | 139 | imagePullSecrets: |
| 140 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |