blob: dc2f5dbb81b5a63f6766763708df719c01953f5f [file] [log] [blame]
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +02001# Copyright © 2018 Orange
Prateekinlinux445a18e2018-08-01 06:48:33 +00002# Modifications Copyright © 2018 Amdocs, Bell Canada
Grzegorz-Lisb97c60a2020-07-29 12:36:06 +02003# Modifications Copyright © 2020 Nokia
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +02004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
Grzegorz-Lisb97c60a2020-07-29 12:36:06 +020017apiVersion: apps/v1
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020018kind: Deployment
19metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020026 heritage: {{ .Release.Service }}
27spec:
Grzegorz-Lisb97c60a2020-07-29 12:36:06 +020028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020031 replicas: {{ .Values.replicaCount }}
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010037 name: {{ include "common.fullname" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020038 spec:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010039{{- if .Values.global.aafEnabled }}
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020040 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010041{{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020042 containers:
43 - name: {{ include "common.name" . }}
44 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
45 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 ports:
47 - containerPort: {{ .Values.service.internalPort }}
48 # disable liveness probe when breakpoints set in debugger
49 # so K8s doesn't restart unresponsive container
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010050 {{- if .Values.global.aafEnabled }}
51 command:
52 - bash
53 args:
54 - -c
55 - |
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020056 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010057 export JAVA_OPTS="-Djavax.net.ssl.trustStorePassword=$cadi_truststore_password \
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020058 -Dserver.ssl.key-store={{ .Values.certInitializer.credsPath }}/org.onap.nbi.p12 \
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010059 -Dserver.ssl.key-store-type=PKCS12 \
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020060 -Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/org.onap.nbi.trust.jks \
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010061 -Dserver.ssl.key-store-password=$cadi_keystore_password_p12 \
62 -Djavax.net.ssl.trustStoreType=jks\
63 -Djava.security.egd=file:/dev/./urandom -Dserver.port=8443"
aosull0125de8362020-04-09 11:05:30 +010064 exec java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010065 {{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020066 {{ if .Values.liveness.enabled }}
67 livenessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010068 httpGet:
69 port: {{ .Values.liveness.port }}
70 path: {{ .Values.liveness.path }}
71 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020072 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
73 periodSeconds: {{ .Values.liveness.periodSeconds }}
74 {{ end }}
75 readinessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010076 httpGet:
77 port: {{ .Values.readiness.port }}
78 path: {{ .Values.readiness.path }}
79 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020080 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.readiness.periodSeconds }}
82 env:
83 - name: SPRING_DATASOURCE_URL
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010084 value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020085 - name: SPRING_DATASOURCE_USERNAME
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010086 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020087 - name: SPRING_DATASOURCE_PASSWORD
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010088 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020089 - name: SPRING_DATA_MONGODB_HOST
90 value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
91 - name: SPRING_DATA_MONGODB_PORT
92 value: "{{ .Values.mongo.service.internalPort }}"
93 - name: SPRING_DATA_MONGODB_DATABASE
94 value: {{ .Values.mongo.config.dbName }}
95 - name: ONAP_LCPCLOUDREGIONID
96 value: {{ .Values.config.openStackRegion }}
97 - name: ONAP_TENANTID
Sylvain Desbureaux33f83672018-06-01 14:28:39 +020098 value: {{ .Values.config.openStackVNFTenantId | quote }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020099 - name: ONAP_CLOUDOWNER
100 value: {{ .Values.config.cloudOwner }}
101 - name: NBI_URL
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100102 value: "https://nbi.{{ include "common.namespace" . }}:8443/nbi/api/v4"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200103 - name: SDC_HOST
Matthieu Geerebaert3dc70822019-11-06 16:57:49 +0100104 value: "https://sdc-be.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200105 - name: SDC_HEADER_ECOMPINSTANCEID
106 value: {{ .Values.config.ecompInstanceId }}
107 - name: SDC_HEADER_AUTHORIZATION
108 value: {{ .Values.sdc_authorization }}
109 - name: AAI_HOST
Eric Debeaub0307652018-05-22 06:43:39 +0000110 value: "https://aai.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200111 - name: AAI_HEADER_AUTHORIZATION
112 value: {{ .Values.aai_authorization }}
113 - name: SO_HOST
114 value: http://so.{{ include "common.namespace" . }}:8080
115 {{- if .Values.so_authorization }}
116 - name: SO_HEADER_AUTHORIZATION
117 value: {{ .Values.so_authorization }}
118 {{- end }}
aosull014a119552019-03-14 15:15:49 +0000119 - name: DMAAP_HOST
aosull0125de8362020-04-09 11:05:30 +0100120 value: "https://message-router.{{ include "common.namespace" . }}:3905"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200121 - name: LOGGING_LEVEL_ORG_ONAP_NBI
122 value: {{ .Values.config.loglevel }}
Quoc Nghia Nguyendd0b3652018-09-17 22:28:28 +0200123 - name: MSB_ENABLED
124 value: "true"
125 - name: MSB_DISCOVERY_HOST
126 value: "msb-discovery.{{ include "common.namespace" . }}"
127 - name: MSB_DISCOVERY_PORT
128 value: "10081"
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +0200129 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200130 - mountPath: /etc/localtime
131 name: localtime
132 readOnly: true
133 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000134{{ include "common.resources" . | indent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200135 {{- if .Values.nodeSelector }}
136 nodeSelector:
137{{ toYaml .Values.nodeSelector | indent 10 }}
138 {{- end -}}
139 {{- if .Values.affinity }}
140 affinity:
141{{ toYaml .Values.affinity | indent 10 }}
142 {{- end }}
143 # side car containers
144 # - name: filebeat-onap
145 # image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
146 # imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
147 # volumeMounts:
148 # - mountPath: /usr/share/filebeat/filebeat.yml
149 # name: filebeat-conf
150 # subPath: filebeat.yml
151 # - mountPath: /home/esr/works/logs
152 # name: esr-server-logs
153 # - mountPath: /usr/share/filebeat/data
154 # name: esr-server-filebeat
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +0200155 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200156 - name: localtime
157 hostPath:
158 path: /etc/localtime
159 # - name: filebeat-conf
160 # configMap:
161 # name: {{ include "common.fullname" . }}-esr-filebeat
162 # - name: esr-server-logs
163 # emptyDir: {}
164 # - name: esr-server-filebeat
165 # emptyDir: {}
166 # - name: esrserver-log
167 # configMap:
168 # name: {{ include "common.fullname" . }}-esr-esrserver-log
169 imagePullSecrets:
170 - name: "{{ include "common.namespace" . }}-docker-registry-key"