Jakub Latusek | d9c241b | 2020-10-21 13:36:30 +0200 | [diff] [blame] | 1 | {{/* |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, Bell Canada |
Krzysztof Opasiak | 4a4703b | 2020-02-08 01:04:48 +0100 | [diff] [blame] | 3 | # Copyright © 2020 Samsung Electronics |
Sylvain Desbureaux | cc3141d | 2021-02-08 15:59:33 +0100 | [diff] [blame] | 4 | # Copyright © 2021 Orange |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
Jakub Latusek | d9c241b | 2020-10-21 13:36:30 +0200 | [diff] [blame] | 17 | */}} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 18 | |
Magdalena_Biernacka | 50b1a39 | 2020-08-11 10:05:24 +0200 | [diff] [blame] | 19 | apiVersion: apps/v1 |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.name" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 28 | heritage: {{ .Release.Service }} |
| 29 | spec: |
Magdalena_Biernacka | 50b1a39 | 2020-08-11 10:05:24 +0200 | [diff] [blame] | 30 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 33 | replicas: {{ .Values.replicaCount }} |
| 34 | template: |
| 35 | metadata: |
| 36 | labels: |
| 37 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 38 | release: {{ include "common.release" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 39 | spec: |
Sylvain Desbureaux | cc3141d | 2021-02-08 15:59:33 +0100 | [diff] [blame] | 40 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 41 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 42 | - /app/ready.py |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 43 | args: |
Sonsino, Ofir (os0695) | 2dda01d | 2018-05-30 18:41:14 +0300 | [diff] [blame] | 44 | - --job-name |
RPMishra | e4ee7f1 | 2020-10-07 12:09:01 +0530 | [diff] [blame] | 45 | - {{ include "common.fullname" . }}-mariadb-init-config-job |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
Sylvain Desbureaux | ab116a5 | 2020-11-19 17:27:59 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | name: {{ include "common.name" . }}-readiness |
| 55 | containers: |
| 56 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | ab116a5 | 2020-11-19 17:27:59 +0100 | [diff] [blame] | 57 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 58 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | cc3141d | 2021-02-08 15:59:33 +0100 | [diff] [blame] | 59 | {{- if .Values.global.aafEnabled }} |
| 60 | command: |
| 61 | - sh |
| 62 | args: |
| 63 | - -c |
| 64 | - | |
| 65 | export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0) |
Krzysztof Opasiak | f4c6175 | 2021-03-18 11:08:36 +0100 | [diff] [blame] | 66 | export VID_TRUSTSTORE_PLAIN_PASSWORD=${VID_TRUSTSTORE_PASSWORD} |
| 67 | export VID_TRUSTSTORE_PASSWORD=`java -cp /usr/local/tomcat/webapps/vid/WEB-INF/lib/jetty-util-9.4.20.v20190813.jar org.eclipse.jetty.util.security.Password ${VID_TRUSTSTORE_PLAIN_PASSWORD} 2>&1 | grep "OBF:"` |
Sylvain Desbureaux | cc3141d | 2021-02-08 15:59:33 +0100 | [diff] [blame] | 68 | /tmp/vid/localize.sh |
| 69 | {{- end }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 70 | ports: |
| 71 | - containerPort: {{ .Values.service.internalPort }} |
| 72 | # disable liveness probe when breakpoints set in debugger |
| 73 | # so K8s doesn't restart unresponsive container |
| 74 | {{- if eq .Values.liveness.enabled true }} |
| 75 | livenessProbe: |
| 76 | tcpSocket: |
| 77 | port: {{ .Values.service.internalPort }} |
| 78 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 80 | {{ end -}} |
| 81 | readinessProbe: |
| 82 | tcpSocket: |
| 83 | port: {{ .Values.service.internalPort }} |
| 84 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 85 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 86 | env: |
| 87 | - name: ASDC_CLIENT_REST_HOST |
mahendrr | bb49cf9 | 2018-04-16 08:33:47 +0000 | [diff] [blame] | 88 | value: sdc-be.{{ include "common.namespace" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 89 | - name: ASDC_CLIENT_REST_AUTH |
| 90 | value: "{{ .Values.config.asdcclientrestauth }}" |
| 91 | - name: ASDC_CLIENT_REST_PORT |
| 92 | value: "{{ .Values.config.asdcclientrestport }}" |
k.kedron | c784bbd | 2019-09-05 18:28:16 +0200 | [diff] [blame] | 93 | - name: ASDC_CLIENT_REST_PROTOCOL |
| 94 | value: "https" |
biniek | b812766 | 2018-11-15 11:25:08 +0100 | [diff] [blame] | 95 | - name: VID_AAI_URL |
| 96 | value: https://aai.{{ include "common.namespace" . }}:{{ .Values.config.vidaaiport }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 97 | - name: VID_ECOMP_SHARED_CONTEXT_REST_URL |
Roger Maitland | 0c6d4b8 | 2018-05-02 16:03:15 -0400 | [diff] [blame] | 98 | value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/context |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 99 | - name: VID_MSO_SERVER_URL |
Piotr Darosz | 2460a79 | 2018-10-05 09:57:42 +0200 | [diff] [blame] | 100 | value: http://so.{{ include "common.namespace" . }}:{{ .Values.config.msoport }}/onap/so/infra |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 101 | - name: VID_MSO_PASS |
| 102 | value: "{{ .Values.config.vidmsopass }}" |
| 103 | - name: MSO_DME2_SERVER_URL |
| 104 | value: "{{ .Values.config.msodme2serverurl }}" |
| 105 | - name: MSO_DME2_ENABLED |
| 106 | value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }} |
| 107 | - name: VID_ECOMP_REDIRECT_URL |
Sonsino, Ofir (os0695) | c9a6edf | 2018-10-18 11:26:03 +0300 | [diff] [blame] | 108 | value: https://{{ .Values.config.portalhost }}:{{ .Values.config.onapport }}/ONAPPORTAL/login.htm |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 109 | - name: VID_ECOMP_REST_URL |
Sonsino, Ofir (os0695) | 73d69b4 | 2018-10-31 10:55:49 +0200 | [diff] [blame] | 110 | value: https://portal-app:{{ .Values.config.onapportrest }}/ONAPPORTAL/auxapi |
Sonsino, Ofir (os0695) | c9a6edf | 2018-10-18 11:26:03 +0300 | [diff] [blame] | 111 | - name: VID_ROLE_ACCESS_CENTRALIZED |
| 112 | value: "{{ .Values.config.roleaccesscentralized }}" |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 113 | - name: VID_CONTACT_US_LINK |
| 114 | value: "{{ .Values.config.vidcontactuslink }}" |
| 115 | - name: VID_UEB_URL_LIST |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 116 | value: message-router.{{ include "common.namespace" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 117 | - name: VID_MYSQL_HOST |
RPMishra | e4ee7f1 | 2020-10-07 12:09:01 +0530 | [diff] [blame] | 118 | value: {{ include "common.mariadbService" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 119 | - name: VID_MYSQL_PORT |
RPMishra | e4ee7f1 | 2020-10-07 12:09:01 +0530 | [diff] [blame] | 120 | value: "{{ include "common.mariadbPort" . }}" |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 121 | - name: VID_MYSQL_DBNAME |
Sylvain Desbureaux | 93a5b49 | 2020-11-27 11:07:42 +0100 | [diff] [blame] | 122 | value: {{ index .Values "mariadb-galera" "db" "name" }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 123 | - name: VID_MYSQL_USER |
Krzysztof Opasiak | e3519ef | 2020-03-24 03:25:05 +0100 | [diff] [blame] | 124 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "login") | indent 14 }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 125 | - name: VID_MYSQL_PASS |
Krzysztof Opasiak | e3519ef | 2020-03-24 03:25:05 +0100 | [diff] [blame] | 126 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "password") | indent 14 }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 127 | - name: VID_MYSQL_MAXCONNECTIONS |
| 128 | value: "{{ .Values.config.vidmysqlmaxconnections }}" |
Sylvain Desbureaux | cc3141d | 2021-02-08 15:59:33 +0100 | [diff] [blame] | 129 | {{- if .Values.global.aafEnabled }} |
| 130 | - name: VID_KEYSTORE_FILENAME |
| 131 | value: "{{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.fqi_namespace }}.jks" |
| 132 | - name: VID_TRUSTSTORE_FILENAME |
| 133 | value: "{{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.fqi_namespace }}.trust.jks" |
| 134 | {{- end }} |
| 135 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 136 | - mountPath: /etc/localtime |
| 137 | name: localtime |
| 138 | readOnly: true |
| 139 | - mountPath: /var/log/onap |
| 140 | name: vid-logs |
| 141 | - mountPath: /tmp/logback.xml |
| 142 | name: vid-logback |
| 143 | subPath: logback.xml |
| 144 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 145 | {{ include "common.resources" . | indent 12 }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [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 }} |
| 153 | {{- end }} |
| 154 | # side car containers |
| 155 | - name: filebeat-onap |
Sylvain Desbureaux | ab116a5 | 2020-11-19 17:27:59 +0100 | [diff] [blame] | 156 | image: {{ include "repositoryGenerator.image.logging" . }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 157 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 158 | volumeMounts: |
| 159 | - mountPath: /usr/share/filebeat/filebeat.yml |
| 160 | name: filebeat-conf |
| 161 | subPath: filebeat.yml |
| 162 | - mountPath: /var/log/onap |
| 163 | name: vid-logs |
| 164 | - mountPath: /usr/share/filebeat/data |
| 165 | name: vid-data-filebeat |
Sylvain Desbureaux | cc3141d | 2021-02-08 15:59:33 +0100 | [diff] [blame] | 166 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Priyanka | 5fdca02 | 2018-03-13 12:53:06 +0000 | [diff] [blame] | 167 | - name: localtime |
| 168 | hostPath: |
| 169 | path: /etc/localtime |
| 170 | - name: filebeat-conf |
| 171 | configMap: |
| 172 | name: {{ include "common.fullname" . }}-filebeat-configmap |
| 173 | - name: vid-logs |
| 174 | emptyDir: {} |
| 175 | - name: vid-data-filebeat |
| 176 | emptyDir: {} |
| 177 | - name: vid-logback |
| 178 | configMap: |
| 179 | name: {{ include "common.fullname" . }}-log-configmap |
| 180 | imagePullSecrets: |
| 181 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |