blob: 8872863e428af3476b70713671157a4b0f4a82b0 [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)
66 /tmp/vid/localize.sh
67 {{- end }}
Priyanka5fdca022018-03-13 12:53:06 +000068 ports:
69 - containerPort: {{ .Values.service.internalPort }}
70 # disable liveness probe when breakpoints set in debugger
71 # so K8s doesn't restart unresponsive container
72 {{- if eq .Values.liveness.enabled true }}
73 livenessProbe:
74 tcpSocket:
75 port: {{ .Values.service.internalPort }}
76 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
77 periodSeconds: {{ .Values.liveness.periodSeconds }}
78 {{ end -}}
79 readinessProbe:
80 tcpSocket:
81 port: {{ .Values.service.internalPort }}
82 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
83 periodSeconds: {{ .Values.readiness.periodSeconds }}
84 env:
85 - name: ASDC_CLIENT_REST_HOST
mahendrrbb49cf92018-04-16 08:33:47 +000086 value: sdc-be.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +000087 - name: ASDC_CLIENT_REST_AUTH
88 value: "{{ .Values.config.asdcclientrestauth }}"
89 - name: ASDC_CLIENT_REST_PORT
90 value: "{{ .Values.config.asdcclientrestport }}"
k.kedronc784bbd2019-09-05 18:28:16 +020091 - name: ASDC_CLIENT_REST_PROTOCOL
92 value: "https"
biniekb8127662018-11-15 11:25:08 +010093 - name: VID_AAI_URL
94 value: https://aai.{{ include "common.namespace" . }}:{{ .Values.config.vidaaiport }}
Priyanka5fdca022018-03-13 12:53:06 +000095 - name: VID_ECOMP_SHARED_CONTEXT_REST_URL
Roger Maitland0c6d4b82018-05-02 16:03:15 -040096 value: http://portal-app.{{ include "common.namespace" . }}:{{ .Values.config.onapport }}/ONAPPORTAL/context
Priyanka5fdca022018-03-13 12:53:06 +000097 - name: VID_MSO_SERVER_URL
Piotr Darosz2460a792018-10-05 09:57:42 +020098 value: http://so.{{ include "common.namespace" . }}:{{ .Values.config.msoport }}/onap/so/infra
Priyanka5fdca022018-03-13 12:53:06 +000099 - name: VID_MSO_PASS
100 value: "{{ .Values.config.vidmsopass }}"
101 - name: MSO_DME2_SERVER_URL
102 value: "{{ .Values.config.msodme2serverurl }}"
103 - name: MSO_DME2_ENABLED
104 value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
105 - name: VID_ECOMP_REDIRECT_URL
Sonsino, Ofir (os0695)c9a6edf2018-10-18 11:26:03 +0300106 value: https://{{ .Values.config.portalhost }}:{{ .Values.config.onapport }}/ONAPPORTAL/login.htm
Priyanka5fdca022018-03-13 12:53:06 +0000107 - name: VID_ECOMP_REST_URL
Sonsino, Ofir (os0695)73d69b42018-10-31 10:55:49 +0200108 value: https://portal-app:{{ .Values.config.onapportrest }}/ONAPPORTAL/auxapi
Sonsino, Ofir (os0695)c9a6edf2018-10-18 11:26:03 +0300109 - name: VID_ROLE_ACCESS_CENTRALIZED
110 value: "{{ .Values.config.roleaccesscentralized }}"
Priyanka5fdca022018-03-13 12:53:06 +0000111 - name: VID_CONTACT_US_LINK
112 value: "{{ .Values.config.vidcontactuslink }}"
113 - name: VID_UEB_URL_LIST
BorislavG1ffbd992018-04-24 07:56:27 +0000114 value: message-router.{{ include "common.namespace" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000115 - name: VID_MYSQL_HOST
RPMishrae4ee7f12020-10-07 12:09:01 +0530116 value: {{ include "common.mariadbService" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000117 - name: VID_MYSQL_PORT
RPMishrae4ee7f12020-10-07 12:09:01 +0530118 value: "{{ include "common.mariadbPort" . }}"
Priyanka5fdca022018-03-13 12:53:06 +0000119 - name: VID_MYSQL_DBNAME
Sylvain Desbureaux93a5b492020-11-27 11:07:42 +0100120 value: {{ index .Values "mariadb-galera" "db" "name" }}
Priyanka5fdca022018-03-13 12:53:06 +0000121 - name: VID_MYSQL_USER
Krzysztof Opasiake3519ef2020-03-24 03:25:05 +0100122 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "login") | indent 14 }}
Priyanka5fdca022018-03-13 12:53:06 +0000123 - name: VID_MYSQL_PASS
Krzysztof Opasiake3519ef2020-03-24 03:25:05 +0100124 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "password") | indent 14 }}
Priyanka5fdca022018-03-13 12:53:06 +0000125 - name: VID_MYSQL_MAXCONNECTIONS
126 value: "{{ .Values.config.vidmysqlmaxconnections }}"
Sylvain Desbureauxcc3141d2021-02-08 15:59:33 +0100127 {{- if .Values.global.aafEnabled }}
128 - name: VID_KEYSTORE_FILENAME
129 value: "{{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.fqi_namespace }}.jks"
130 - name: VID_TRUSTSTORE_FILENAME
131 value: "{{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.fqi_namespace }}.trust.jks"
132 {{- end }}
133 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Priyanka5fdca022018-03-13 12:53:06 +0000134 - mountPath: /etc/localtime
135 name: localtime
136 readOnly: true
137 - mountPath: /var/log/onap
138 name: vid-logs
139 - mountPath: /tmp/logback.xml
140 name: vid-logback
141 subPath: logback.xml
142 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000143{{ include "common.resources" . | indent 12 }}
Priyanka5fdca022018-03-13 12:53:06 +0000144 {{- if .Values.nodeSelector }}
145 nodeSelector:
146{{ toYaml .Values.nodeSelector | indent 10 }}
147 {{- end -}}
148 {{- if .Values.affinity }}
149 affinity:
150{{ toYaml .Values.affinity | indent 10 }}
151 {{- end }}
152 # side car containers
153 - name: filebeat-onap
Sylvain Desbureauxab116a52020-11-19 17:27:59 +0100154 image: {{ include "repositoryGenerator.image.logging" . }}
Priyanka5fdca022018-03-13 12:53:06 +0000155 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
156 volumeMounts:
157 - mountPath: /usr/share/filebeat/filebeat.yml
158 name: filebeat-conf
159 subPath: filebeat.yml
160 - mountPath: /var/log/onap
161 name: vid-logs
162 - mountPath: /usr/share/filebeat/data
163 name: vid-data-filebeat
Sylvain Desbureauxcc3141d2021-02-08 15:59:33 +0100164 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Priyanka5fdca022018-03-13 12:53:06 +0000165 - name: localtime
166 hostPath:
167 path: /etc/localtime
168 - name: filebeat-conf
169 configMap:
170 name: {{ include "common.fullname" . }}-filebeat-configmap
171 - name: vid-logs
172 emptyDir: {}
173 - name: vid-data-filebeat
174 emptyDir: {}
175 - name: vid-logback
176 configMap:
177 name: {{ include "common.fullname" . }}-log-configmap
178 imagePullSecrets:
179 - name: "{{ include "common.namespace" . }}-docker-registry-key"