Jakub Latusek | 2bd138d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 2 | # Copyright © 2018 Amdocs |
| 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 | 2bd138d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 16 | |
| 17 | apiVersion: extensions/v1beta1 |
| 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
| 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
| 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 37 | name: {{ include "common.name" . }} |
| 38 | spec: |
| 39 | initContainers: |
| 40 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 41 | - /app/ready.py |
jmac | af645b5 | 2018-10-11 12:21:54 +0000 | [diff] [blame] | 42 | args: |
| 43 | - --container-name |
| 44 | - pomba-search-data |
| 45 | env: |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 93ed075 | 2020-11-21 21:22:18 +0100 | [diff] [blame] | 51 | image: {{ include "repositoryGenerator.image.readiness" . }} |
jmac | af645b5 | 2018-10-11 12:21:54 +0000 | [diff] [blame] | 52 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 53 | name: {{ include "common.name" . }}-readiness |
| 54 | - command: |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 55 | - /bin/sh |
| 56 | - -c |
| 57 | - | |
| 58 | mkdir -p /logroot/data-router/logs |
| 59 | chmod -R 777 /logroot/data-router/logs |
| 60 | chown -R root:root /logroot |
| 61 | env: |
| 62 | - name: NAMESPACE |
| 63 | valueFrom: |
| 64 | fieldRef: |
| 65 | apiVersion: v1 |
| 66 | fieldPath: metadata.namespace |
| 67 | securityContext: |
| 68 | privileged: true |
Sylvain Desbureaux | 93ed075 | 2020-11-21 21:22:18 +0100 | [diff] [blame] | 69 | image: {{ include "repositoryGenerator.image.busybox" . }} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 70 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 71 | name: init-sysctl |
| 72 | volumeMounts: |
| 73 | - name: {{ include "common.fullname" . }}-logs |
| 74 | mountPath: /logroot/ |
| 75 | containers: |
| 76 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 93ed075 | 2020-11-21 21:22:18 +0100 | [diff] [blame] | 77 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 78 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 79 | env: |
| 80 | - name: SERVICE_BEANS |
| 81 | value: /opt/app/data-router/dynamic/conf |
| 82 | - name: CONFIG_HOME |
| 83 | value: /opt/app/data-router/config/ |
| 84 | - name: KEY_STORE_PASSWORD |
| 85 | value: {{ .Values.config.keyStorePassword }} |
| 86 | - name: DYNAMIC_ROUTES |
| 87 | value: /opt/app/data-router/dynamic/routes |
| 88 | - name: KEY_MANAGER_PASSWORD |
| 89 | value: {{ .Values.config.keyManagerPassword }} |
| 90 | volumeMounts: |
| 91 | - mountPath: /etc/localtime |
| 92 | name: localtime |
| 93 | readOnly: true |
| 94 | - mountPath: /opt/app/data-router/config/auth |
| 95 | name: {{ include "common.fullname" . }}-auth |
| 96 | - mountPath: /opt/app/data-router/config/data-router.properties |
| 97 | subPath: data-router.properties |
| 98 | name: {{ include "common.fullname" . }}-properties |
| 99 | - mountPath: /opt/app/data-router/config/schemaIngest.properties |
| 100 | subPath: schemaIngest.properties |
| 101 | name: {{ include "common.fullname" . }}-properties |
| 102 | - mountPath: /opt/app/data-router/dynamic/routes/audit.route |
| 103 | subPath: audit.route |
| 104 | name: {{ include "common.fullname" . }}-dynamic-route |
| 105 | - mountPath: /opt/app/data-router/dynamic/routes/poaValidation.route |
| 106 | subPath: poaValidation.route |
| 107 | name: {{ include "common.fullname" . }}-dynamic-route |
| 108 | - mountPath: /opt/app/data-router/dynamic/conf/audit-bean.xml |
| 109 | subPath: audit-bean.xml |
| 110 | name: {{ include "common.fullname" . }}-dynamic-policy |
| 111 | - mountPath: /opt/app/data-router/dynamic/conf/poa-validation-bean.xml |
| 112 | subPath: poa-validation-bean.xml |
| 113 | name: {{ include "common.fullname" . }}-dynamic-policy |
| 114 | - mountPath: /logs/ |
| 115 | name: {{ include "common.fullname" . }}-logs |
Sylvain Desbureaux | bbf5ace | 2018-11-23 16:45:04 +0100 | [diff] [blame] | 116 | resources: |
| 117 | {{ include "common.resources" . | indent 10 }} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 118 | ports: |
| 119 | - containerPort: {{ .Values.service.internalPort }} |
| 120 | {{- if eq .Values.liveness.enabled true }} |
| 121 | livenessProbe: |
| 122 | tcpSocket: |
| 123 | port: {{ .Values.service.internalPort }} |
| 124 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 125 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 126 | {{ end -}} |
| 127 | readinessProbe: |
| 128 | tcpSocket: |
| 129 | port: {{ .Values.service.internalPort }} |
| 130 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 131 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
jmac | 76d4a8a | 2019-02-21 20:03:49 +0000 | [diff] [blame] | 132 | |
| 133 | # Filebeat sidecar container |
| 134 | - name: {{ include "common.name" . }}-filebeat-onap |
Sylvain Desbureaux | 93ed075 | 2020-11-21 21:22:18 +0100 | [diff] [blame] | 135 | image: {{ include "repositoryGenerator.image.logging" . }} |
jmac | 76d4a8a | 2019-02-21 20:03:49 +0000 | [diff] [blame] | 136 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 137 | volumeMounts: |
| 138 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 139 | mountPath: /usr/share/filebeat/filebeat.yml |
| 140 | subPath: filebeat.yml |
| 141 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 142 | mountPath: /usr/share/filebeat/data |
| 143 | - name: {{ include "common.fullname" . }}-logs |
| 144 | mountPath: /opt/app/logs |
| 145 | |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 146 | volumes: |
| 147 | - name: localtime |
| 148 | hostPath: |
| 149 | path: /etc/localtime |
| 150 | - name: {{ include "common.fullname" . }}-auth |
| 151 | secret: |
| 152 | secretName: {{ include "common.fullname" . }} |
| 153 | - name: {{ include "common.fullname" . }}-properties |
| 154 | configMap: |
| 155 | name: {{ include "common.fullname" . }}-prop |
| 156 | items: |
| 157 | - key: data-router.properties |
| 158 | path: data-router.properties |
| 159 | - key: schemaIngest.properties |
| 160 | path: schemaIngest.properties |
jmac | 76d4a8a | 2019-02-21 20:03:49 +0000 | [diff] [blame] | 161 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 162 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 163 | name: {{ include "common.release" . }}-pomba-filebeat-configmap |
jmac | 76d4a8a | 2019-02-21 20:03:49 +0000 | [diff] [blame] | 164 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 165 | emptyDir: {} |
Jennie Jia | 20bb5cd | 2018-08-16 15:50:33 +0000 | [diff] [blame] | 166 | - name: {{ include "common.fullname" . }}-dynamic-route |
| 167 | configMap: |
| 168 | name: {{ include "common.fullname" . }}-dynamic |
| 169 | - name: {{ include "common.fullname" . }}-dynamic-policy |
| 170 | configMap: |
| 171 | name: {{ include "common.fullname" . }}-dynamic |
| 172 | - name: {{ include "common.fullname" . }}-logs |
| 173 | persistentVolumeClaim: |
| 174 | claimName: {{ include "common.fullname" . }} |
| 175 | restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} |
| 176 | imagePullSecrets: |
| 177 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |