blob: d1b4bcdbf2886b30302ca91c37ce20dd00231c58 [file] [log] [blame]
Jakub Latusekd9c241b2020-10-21 13:36:30 +02001{{/*
Priyanka5fdca022018-03-13 12:53:06 +00002# Copyright © 2017 Amdocs, Bell Canada
Krzysztof Opasiak4a4703b2020-02-08 01:04:48 +01003# Copyright © 2020 Samsung Electronics
Sylvain Desbureauxcc3141d2021-02-08 15:59:33 +01004# Copyright © 2021 Orange
Priyanka5fdca022018-03-13 12:53:06 +00005#
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 Latusekd9c241b2020-10-21 13:36:30 +020017*/}}
Priyanka5fdca022018-03-13 12:53:06 +000018
Magdalena_Biernacka50b1a392020-08-11 10:05:24 +020019apiVersion: apps/v1
Priyanka5fdca022018-03-13 12:53:06 +000020kind: Deployment
21metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010027 release: {{ include "common.release" . }}
Priyanka5fdca022018-03-13 12:53:06 +000028 heritage: {{ .Release.Service }}
29spec:
Magdalena_Biernacka50b1a392020-08-11 10:05:24 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Priyanka5fdca022018-03-13 12:53:06 +000033 replicas: {{ .Values.replicaCount }}
34 template:
35 metadata:
36 labels:
37 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010038 release: {{ include "common.release" . }}
Priyanka5fdca022018-03-13 12:53:06 +000039 spec:
Sylvain Desbureauxcc3141d2021-02-08 15:59:33 +010040 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Priyanka5fdca022018-03-13 12:53:06 +000041 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020042 - /app/ready.py
Priyanka5fdca022018-03-13 12:53:06 +000043 args:
Sonsino, Ofir (os0695)2dda01d2018-05-30 18:41:14 +030044 - --job-name
RPMishrae4ee7f12020-10-07 12:09:01 +053045 - {{ include "common.fullname" . }}-mariadb-init-config-job
Priyanka5fdca022018-03-13 12:53:06 +000046 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
Sylvain Desbureauxab116a52020-11-19 17:27:59 +010052 image: {{ include "repositoryGenerator.image.readiness" . }}
Priyanka5fdca022018-03-13 12:53:06 +000053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 name: {{ include "common.name" . }}-readiness
55 containers:
56 - name: {{ include "common.name" . }}
Sylvain Desbureauxab116a52020-11-19 17:27:59 +010057 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Priyanka5fdca022018-03-13 12:53:06 +000058 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxcc3141d2021-02-08 15:59:33 +010059 {{- if .Values.global.aafEnabled }}
60 command:
61 - sh
62 args:
63 - -c
64 - |
65 export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
Krzysztof Opasiakf4c61752021-03-18 11:08:36 +010066 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 Desbureauxcc3141d2021-02-08 15:59:33 +010068 /tmp/vid/localize.sh
69 {{- end }}
Priyanka5fdca022018-03-13 12:53:06 +000070 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
mahendrrbb49cf92018-04-16 08:33:47 +000088 value: sdc-be.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +000089 - name: ASDC_CLIENT_REST_AUTH
90 value: "{{ .Values.config.asdcclientrestauth }}"
91 - name: ASDC_CLIENT_REST_PORT
92 value: "{{ .Values.config.asdcclientrestport }}"
k.kedronc784bbd2019-09-05 18:28:16 +020093 - name: ASDC_CLIENT_REST_PROTOCOL
94 value: "https"
biniekb8127662018-11-15 11:25:08 +010095 - name: VID_AAI_URL
96 value: https://aai.{{ include "common.namespace" . }}:{{ .Values.config.vidaaiport }}
Priyanka5fdca022018-03-13 12:53:06 +000097 - name: VID_ECOMP_SHARED_CONTEXT_REST_URL
Roger Maitland0c6d4b82018-05-02 16:03:15 -040098 value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/context
Priyanka5fdca022018-03-13 12:53:06 +000099 - name: VID_MSO_SERVER_URL
Piotr Darosz2460a792018-10-05 09:57:42 +0200100 value: http://so.{{ include "common.namespace" . }}:{{ .Values.config.msoport }}/onap/so/infra
Priyanka5fdca022018-03-13 12:53:06 +0000101 - 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)c9a6edf2018-10-18 11:26:03 +0300108 value: https://{{ .Values.config.portalhost }}:{{ .Values.config.onapport }}/ONAPPORTAL/login.htm
Priyanka5fdca022018-03-13 12:53:06 +0000109 - name: VID_ECOMP_REST_URL
Sonsino, Ofir (os0695)73d69b42018-10-31 10:55:49 +0200110 value: https://portal-app:{{ .Values.config.onapportrest }}/ONAPPORTAL/auxapi
Sonsino, Ofir (os0695)c9a6edf2018-10-18 11:26:03 +0300111 - name: VID_ROLE_ACCESS_CENTRALIZED
112 value: "{{ .Values.config.roleaccesscentralized }}"
Priyanka5fdca022018-03-13 12:53:06 +0000113 - name: VID_CONTACT_US_LINK
114 value: "{{ .Values.config.vidcontactuslink }}"
115 - name: VID_UEB_URL_LIST
BorislavG1ffbd992018-04-24 07:56:27 +0000116 value: message-router.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000117 - name: VID_MYSQL_HOST
RPMishrae4ee7f12020-10-07 12:09:01 +0530118 value: {{ include "common.mariadbService" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000119 - name: VID_MYSQL_PORT
RPMishrae4ee7f12020-10-07 12:09:01 +0530120 value: "{{ include "common.mariadbPort" . }}"
Priyanka5fdca022018-03-13 12:53:06 +0000121 - name: VID_MYSQL_DBNAME
Sylvain Desbureaux93a5b492020-11-27 11:07:42 +0100122 value: {{ index .Values "mariadb-galera" "db" "name" }}
Priyanka5fdca022018-03-13 12:53:06 +0000123 - name: VID_MYSQL_USER
Krzysztof Opasiake3519ef2020-03-24 03:25:05 +0100124 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "login") | indent 14 }}
Priyanka5fdca022018-03-13 12:53:06 +0000125 - name: VID_MYSQL_PASS
Krzysztof Opasiake3519ef2020-03-24 03:25:05 +0100126 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "password") | indent 14 }}
Priyanka5fdca022018-03-13 12:53:06 +0000127 - name: VID_MYSQL_MAXCONNECTIONS
128 value: "{{ .Values.config.vidmysqlmaxconnections }}"
Sylvain Desbureauxcc3141d2021-02-08 15:59:33 +0100129 {{- 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 }}
Priyanka5fdca022018-03-13 12:53:06 +0000136 - 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 Khinda5e3f36a2018-09-24 15:25:42 +0000145{{ include "common.resources" . | indent 12 }}
Priyanka5fdca022018-03-13 12:53:06 +0000146 {{- 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 Desbureauxab116a52020-11-19 17:27:59 +0100156 image: {{ include "repositoryGenerator.image.logging" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000157 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 Desbureauxcc3141d2021-02-08 15:59:33 +0100166 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Priyanka5fdca022018-03-13 12:53:06 +0000167 - 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"