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 "+" "_" }} |
| 22 | release: {{ .Release.Name }} |
| 23 | heritage: {{ .Release.Service }} |
| 24 | spec: |
| 25 | replicas: {{ .Values.replicaCount }} |
| 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: {{ include "common.name" . }} |
| 30 | release: {{ .Release.Name }} |
| 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 }} |
| 49 | - name: {{ include "common.name" . }}-dr-prov-aaf-config |
| 50 | image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}" |
| 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 52 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
| 53 | volumeMounts: |
| 54 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 55 | name: {{ include "common.fullname" . }}-aaf-config-vol |
| 56 | env: |
| 57 | - name: APP_FQI |
| 58 | value: "{{ .Values.aafConfig.fqi }}" |
| 59 | - name: aaf_locate_url |
| 60 | value: "https://aaf-locate.{{ .Release.Namespace }}:8095" |
| 61 | - name: aaf_locator_container |
| 62 | value: "{{ .Values.global.aafLocatorContainer }}" |
| 63 | - name: aaf_locator_container_ns |
| 64 | value: "{{ .Release.Namespace }}" |
| 65 | - name: aaf_locator_fqdn |
| 66 | value: "{{ .Values.aafConfig.fqdn }}" |
| 67 | - name: aaf_locator_public_fqdn |
| 68 | value: "{{.Values.aafConfig.publicFqdn}}" |
| 69 | - name: aaf_locator_app_ns |
| 70 | value: "{{ .Values.global.aafAppNs }}" |
| 71 | - name: DEPLOY_FQI |
| 72 | value: "{{ .Values.aafConfig.aafDeployFqi }}" |
| 73 | - name: DEPLOY_PASSWORD |
| 74 | value: "{{ .Values.aafConfig.aafDeployPass }}" |
| 75 | - name: cadi_longitude |
| 76 | value: "{{ .Values.aafConfig.cadiLongitude }}" |
| 77 | - name: cadi_latitude |
| 78 | value: "{{ .Values.aafConfig.cadiLatitude }}" |
| 79 | - name: {{ include "common.name" . }}-permission-fixer |
| 80 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 81 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 82 | volumeMounts: |
| 83 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 84 | name: {{ include "common.fullname" . }}-aaf-config-vol |
| 85 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
| 86 | {{ end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 87 | containers: |
| 88 | - name: {{ include "common.name" . }} |
| 89 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 90 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 91 | ports: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 92 | - containerPort: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 93 | {{- if eq .Values.liveness.enabled true }} |
| 94 | livenessProbe: |
| 95 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 96 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 97 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 98 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 99 | {{ end -}} |
| 100 | readinessProbe: |
| 101 | tcpSocket: |
efiacor | 18e43fd | 2019-10-03 19:57:52 +0100 | [diff] [blame] | 102 | port: {{ .Values.config.dmaapDrProv.internalPort }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 103 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 104 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 105 | volumeMounts: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 106 | {{- if .Values.global.aafEnabled }} |
| 107 | - mountPath: {{ .Values.persistence.aafCredsPath }} |
| 108 | name: {{ include "common.fullname" . }}-aaf-config-vol |
| 109 | {{- end }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 110 | - mountPath: /etc/localtime |
| 111 | name: localtime |
| 112 | readOnly: false |
| 113 | - mountPath: /opt/app/datartr/etc/provserver.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 114 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 115 | subPath: provserver.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 116 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 117 | name: {{ include "common.fullname" . }}-log-conf |
| 118 | subPath: logback.xml |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 119 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 120 | name: {{ include "common.fullname" . }}-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 121 | resources: |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 122 | {{ include "common.resources" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 123 | {{- if .Values.nodeSelector }} |
| 124 | nodeSelector: |
| 125 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 126 | {{- end -}} |
| 127 | {{- if .Values.affinity }} |
| 128 | affinity: |
| 129 | {{ toYaml .Values.affinity | indent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 130 | {{- end -}} |
| 131 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 132 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 133 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 134 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 135 | volumeMounts: |
| 136 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 137 | mountPath: /usr/share/filebeat/filebeat.yml |
| 138 | subPath: filebeat.yml |
| 139 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 140 | mountPath: /usr/share/filebeat/data |
| 141 | - name: {{ include "common.fullname" . }}-logs |
| 142 | mountPath: /var/log/onap/datarouter-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 143 | volumes: |
| 144 | - name: localtime |
| 145 | hostPath: |
| 146 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 147 | - name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 148 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 149 | name: {{ include "common.fullname" . }}-configmap |
| 150 | items: |
| 151 | - key: provserver.properties |
| 152 | path: provserver.properties |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 153 | - name: {{ include "common.fullname" . }}-log-conf |
| 154 | configMap: |
| 155 | name: {{ include "common.fullname" . }}-log |
| 156 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 157 | configMap: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 158 | name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 159 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 160 | emptyDir: {} |
| 161 | - name: {{ include "common.fullname" . }}-logs |
| 162 | emptyDir: {} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 163 | {{- if .Values.global.aafEnabled }} |
| 164 | - name: {{ include "common.fullname" . }}-aaf-config-vol |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 165 | {{- if .Values.persistence.enabled }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 166 | persistentVolumeClaim: |
| 167 | claimName: {{ include "common.fullname" . }}-aaf-props |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 168 | {{- else }} |
| 169 | emptyDir: {} |
| 170 | {{- end }} |
| 171 | {{- end }} |
Sylvain Desbureaux | 435ef53 | 2018-12-20 10:58:09 +0100 | [diff] [blame] | 172 | imagePullSecrets: |
| 173 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |