blob: 328323910092583d54ed744b0e12326ed60542a5 [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
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +02003#
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.
15
16apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020025 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010033 name: {{ include "common.fullname" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020034 spec:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010035{{- if .Values.global.aafEnabled }}
36 initContainers: {{ include "common.aaf-config" . | nindent 6 }}
37{{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020038 containers:
39 - name: {{ include "common.name" . }}
40 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
41 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42 ports:
43 - containerPort: {{ .Values.service.internalPort }}
44 # disable liveness probe when breakpoints set in debugger
45 # so K8s doesn't restart unresponsive container
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010046 {{- if .Values.global.aafEnabled }}
47 command:
48 - bash
49 args:
50 - -c
51 - |
52 export $(grep '^c' {{ .Values.aafConfig.credsPath }}/mycreds.prop | xargs -0)
53 export JAVA_OPTS="-Djavax.net.ssl.trustStorePassword=$cadi_truststore_password \
54 -Dserver.ssl.key-store={{ .Values.aafConfig.credsPath }}/org.onap.nbi.p12 \
55 -Dserver.ssl.key-store-type=PKCS12 \
56 -Djavax.net.ssl.trustStore={{ .Values.aafConfig.credsPath }}/org.onap.nbi.trust.jks \
57 -Dserver.ssl.key-store-password=$cadi_keystore_password_p12 \
58 -Djavax.net.ssl.trustStoreType=jks\
59 -Djava.security.egd=file:/dev/./urandom -Dserver.port=8443"
60 {{- if eq "DEBUG" .Values.config.loglevel }}
61 export JAVA_DEBUG="-Djavax.net.debug=all"
62 {{- end }}
63 exec java -XX:+UseContainerSupport $JAVA_DEBUG $JAVA_OPTS -jar /opt/onap/app.jar
64 {{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020065 {{ if .Values.liveness.enabled }}
66 livenessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010067 httpGet:
68 port: {{ .Values.liveness.port }}
69 path: {{ .Values.liveness.path }}
70 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020071 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.liveness.periodSeconds }}
73 {{ end }}
74 readinessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010075 httpGet:
76 port: {{ .Values.readiness.port }}
77 path: {{ .Values.readiness.path }}
78 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020079 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
80 periodSeconds: {{ .Values.readiness.periodSeconds }}
81 env:
82 - name: SPRING_DATASOURCE_URL
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010083 value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020084 - name: SPRING_DATASOURCE_USERNAME
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010085 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020086 - name: SPRING_DATASOURCE_PASSWORD
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010087 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020088 - name: SPRING_DATA_MONGODB_HOST
89 value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
90 - name: SPRING_DATA_MONGODB_PORT
91 value: "{{ .Values.mongo.service.internalPort }}"
92 - name: SPRING_DATA_MONGODB_DATABASE
93 value: {{ .Values.mongo.config.dbName }}
94 - name: ONAP_LCPCLOUDREGIONID
95 value: {{ .Values.config.openStackRegion }}
96 - name: ONAP_TENANTID
Sylvain Desbureaux33f83672018-06-01 14:28:39 +020097 value: {{ .Values.config.openStackVNFTenantId | quote }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020098 - name: ONAP_CLOUDOWNER
99 value: {{ .Values.config.cloudOwner }}
100 - name: NBI_URL
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100101 value: "https://nbi.{{ include "common.namespace" . }}:8443/nbi/api/v4"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200102 - name: SDC_HOST
Matthieu Geerebaert3dc70822019-11-06 16:57:49 +0100103 value: "https://sdc-be.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200104 - name: SDC_HEADER_ECOMPINSTANCEID
105 value: {{ .Values.config.ecompInstanceId }}
106 - name: SDC_HEADER_AUTHORIZATION
107 value: {{ .Values.sdc_authorization }}
108 - name: AAI_HOST
Eric Debeaub0307652018-05-22 06:43:39 +0000109 value: "https://aai.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200110 - name: AAI_HEADER_AUTHORIZATION
111 value: {{ .Values.aai_authorization }}
112 - name: SO_HOST
113 value: http://so.{{ include "common.namespace" . }}:8080
114 {{- if .Values.so_authorization }}
115 - name: SO_HEADER_AUTHORIZATION
116 value: {{ .Values.so_authorization }}
117 {{- end }}
aosull014a119552019-03-14 15:15:49 +0000118 - name: DMAAP_HOST
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100119 value: "http://message-router.{{ include "common.namespace" . }}:3904"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200120 - name: LOGGING_LEVEL_ORG_ONAP_NBI
121 value: {{ .Values.config.loglevel }}
Quoc Nghia Nguyendd0b3652018-09-17 22:28:28 +0200122 - name: MSB_ENABLED
123 value: "true"
124 - name: MSB_DISCOVERY_HOST
125 value: "msb-discovery.{{ include "common.namespace" . }}"
126 - name: MSB_DISCOVERY_PORT
127 value: "10081"
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100128 volumeMounts: {{ include "common.aaf-config-volume-mountpath" . | nindent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200129 - mountPath: /etc/localtime
130 name: localtime
131 readOnly: true
132 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000133{{ include "common.resources" . | indent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200134 {{- if .Values.nodeSelector }}
135 nodeSelector:
136{{ toYaml .Values.nodeSelector | indent 10 }}
137 {{- end -}}
138 {{- if .Values.affinity }}
139 affinity:
140{{ toYaml .Values.affinity | indent 10 }}
141 {{- end }}
142 # side car containers
143 # - name: filebeat-onap
144 # image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
145 # imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
146 # volumeMounts:
147 # - mountPath: /usr/share/filebeat/filebeat.yml
148 # name: filebeat-conf
149 # subPath: filebeat.yml
150 # - mountPath: /home/esr/works/logs
151 # name: esr-server-logs
152 # - mountPath: /usr/share/filebeat/data
153 # name: esr-server-filebeat
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100154 volumes: {{ include "common.aaf-config-volumes" . | nindent 8 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200155 - name: localtime
156 hostPath:
157 path: /etc/localtime
158 # - name: filebeat-conf
159 # configMap:
160 # name: {{ include "common.fullname" . }}-esr-filebeat
161 # - name: esr-server-logs
162 # emptyDir: {}
163 # - name: esr-server-filebeat
164 # emptyDir: {}
165 # - name: esrserver-log
166 # configMap:
167 # name: {{ include "common.fullname" . }}-esr-esrserver-log
168 imagePullSecrets:
169 - name: "{{ include "common.namespace" . }}-docker-registry-key"