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. |
| 14 | apiVersion: extensions/v1beta1 |
| 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: |
| 25 | replicas: {{ .Values.replicaCount }} |
| 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 30 | release: {{ include "common.release" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 31 | spec: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 32 | hostname: {{ .Values.global.dmaapDrProvName }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 33 | initContainers: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 34 | - name: {{ include "common.name" . }}-readiness |
| 35 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 36 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 37 | command: |
| 38 | - /root/ready.py |
| 39 | args: |
| 40 | - --container-name |
| 41 | - {{ .Values.config.dmaapDrDb.mariadbContName }} |
| 42 | env: |
| 43 | - name: NAMESPACE |
| 44 | valueFrom: |
| 45 | fieldRef: |
| 46 | apiVersion: v1 |
| 47 | fieldPath: metadata.namespace |
| 48 | {{- if .Values.global.aafEnabled }} |
Sylvain Desbureaux | d398482 | 2019-12-27 11:06:14 +0100 | [diff] [blame] | 49 | - name: {{ include "common.name" . }}-aaf-readiness |
| 50 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 52 | command: |
| 53 | - /root/ready.py |
| 54 | args: |
| 55 | - --container-name |
| 56 | - aaf-locate |
efiacor | a03527b | 2020-02-07 19:02:15 +0000 | [diff] [blame] | 57 | - --container-name |
| 58 | - aaf-cm |
efiacor | 45ba53a | 2020-02-28 12:46:07 +0000 | [diff] [blame] | 59 | - --container-name |
| 60 | - aaf-service |
Sylvain Desbureaux | d398482 | 2019-12-27 11:06:14 +0100 | [diff] [blame] | 61 | env: |
| 62 | - name: NAMESPACE |
| 63 | valueFrom: |
| 64 | fieldRef: |
| 65 | apiVersion: v1 |
| 66 | fieldPath: metadata.namespace |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 67 | - name: {{ include "common.name" . }}-dr-prov-aaf-config |
| 68 | image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}" |
| 69 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 70 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
| 71 | volumeMounts: |
| 72 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 73 | name: {{ include "common.fullname" . }}-aaf-config-vol |
| 74 | env: |
| 75 | - name: APP_FQI |
| 76 | value: "{{ .Values.aafConfig.fqi }}" |
| 77 | - name: aaf_locate_url |
| 78 | value: "https://aaf-locate.{{ .Release.Namespace }}:8095" |
| 79 | - name: aaf_locator_container |
| 80 | value: "{{ .Values.global.aafLocatorContainer }}" |
| 81 | - name: aaf_locator_container_ns |
| 82 | value: "{{ .Release.Namespace }}" |
| 83 | - name: aaf_locator_fqdn |
| 84 | value: "{{ .Values.aafConfig.fqdn }}" |
| 85 | - name: aaf_locator_public_fqdn |
| 86 | value: "{{.Values.aafConfig.publicFqdn}}" |
| 87 | - name: aaf_locator_app_ns |
| 88 | value: "{{ .Values.global.aafAppNs }}" |
| 89 | - name: DEPLOY_FQI |
| 90 | value: "{{ .Values.aafConfig.aafDeployFqi }}" |
| 91 | - name: DEPLOY_PASSWORD |
| 92 | value: "{{ .Values.aafConfig.aafDeployPass }}" |
| 93 | - name: cadi_longitude |
| 94 | value: "{{ .Values.aafConfig.cadiLongitude }}" |
| 95 | - name: cadi_latitude |
| 96 | value: "{{ .Values.aafConfig.cadiLatitude }}" |
| 97 | - name: {{ include "common.name" . }}-permission-fixer |
| 98 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 99 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 100 | volumeMounts: |
| 101 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 102 | name: {{ include "common.fullname" . }}-aaf-config-vol |
| 103 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
| 104 | {{ end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 105 | containers: |
| 106 | - name: {{ include "common.name" . }} |
| 107 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 108 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 109 | ports: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 110 | - containerPort: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 111 | {{- if eq .Values.liveness.enabled true }} |
| 112 | livenessProbe: |
| 113 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 114 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 115 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 116 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 117 | {{ end -}} |
| 118 | readinessProbe: |
| 119 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 120 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 121 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 122 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Krzysztof Opasiak | e55b4d5 | 2020-02-07 22:54:20 +0100 | [diff] [blame] | 123 | env: |
| 124 | - name: DB_USERNAME |
Krzysztof Opasiak | b2c2383 | 2020-03-24 03:27:03 +0100 | [diff] [blame] | 125 | {{- 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] | 126 | - name: DB_PASSWORD |
Krzysztof Opasiak | b2c2383 | 2020-03-24 03:27:03 +0100 | [diff] [blame] | 127 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "password") | indent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 128 | volumeMounts: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 129 | {{- if .Values.global.aafEnabled }} |
| 130 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 131 | name: {{ include "common.fullname" . }}-aaf-config-vol |
| 132 | {{- end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 133 | - mountPath: /etc/localtime |
| 134 | name: localtime |
| 135 | readOnly: false |
| 136 | - mountPath: /opt/app/datartr/etc/provserver.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 137 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 138 | subPath: provserver.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 139 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 140 | name: {{ include "common.fullname" . }}-log-conf |
| 141 | subPath: logback.xml |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 142 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 143 | name: {{ include "common.fullname" . }}-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 144 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 145 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 146 | {{- if .Values.nodeSelector }} |
| 147 | nodeSelector: |
| 148 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 149 | {{- end -}} |
| 150 | {{- if .Values.affinity }} |
| 151 | affinity: |
| 152 | {{ toYaml .Values.affinity | indent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 153 | {{- end -}} |
| 154 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 155 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 156 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 157 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 158 | volumeMounts: |
| 159 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 160 | mountPath: /usr/share/filebeat/filebeat.yml |
| 161 | subPath: filebeat.yml |
| 162 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 163 | mountPath: /usr/share/filebeat/data |
| 164 | - name: {{ include "common.fullname" . }}-logs |
| 165 | mountPath: /var/log/onap/datarouter-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 166 | volumes: |
| 167 | - name: localtime |
| 168 | hostPath: |
| 169 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 170 | - name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 171 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 172 | name: {{ include "common.fullname" . }}-configmap |
| 173 | items: |
| 174 | - key: provserver.properties |
| 175 | path: provserver.properties |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 176 | - name: {{ include "common.fullname" . }}-log-conf |
| 177 | configMap: |
| 178 | name: {{ include "common.fullname" . }}-log |
| 179 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 180 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 181 | name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 182 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 183 | emptyDir: {} |
| 184 | - name: {{ include "common.fullname" . }}-logs |
| 185 | emptyDir: {} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 186 | {{- if .Values.global.aafEnabled }} |
| 187 | - name: {{ include "common.fullname" . }}-aaf-config-vol |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 188 | {{- if .Values.persistence.enabled }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 189 | persistentVolumeClaim: |
| 190 | claimName: {{ include "common.fullname" . }}-aaf-props |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 191 | {{- else }} |
| 192 | emptyDir: {} |
| 193 | {{- end }} |
| 194 | {{- end }} |
Sylvain Desbureaux | 435ef53 | 2018-12-20 10:58:09 +0100 | [diff] [blame] | 195 | imagePullSecrets: |
| 196 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |