blob: 1b4195c733776738fa91feb613313464e70f0e11 [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"
aosull0125de8362020-04-09 11:05:30 +010060 exec java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010061 {{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020062 {{ if .Values.liveness.enabled }}
63 livenessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010064 httpGet:
65 port: {{ .Values.liveness.port }}
66 path: {{ .Values.liveness.path }}
67 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020068 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.liveness.periodSeconds }}
70 {{ end }}
71 readinessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010072 httpGet:
73 port: {{ .Values.readiness.port }}
74 path: {{ .Values.readiness.path }}
75 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020076 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
77 periodSeconds: {{ .Values.readiness.periodSeconds }}
78 env:
79 - name: SPRING_DATASOURCE_URL
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010080 value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020081 - name: SPRING_DATASOURCE_USERNAME
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010082 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020083 - name: SPRING_DATASOURCE_PASSWORD
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010084 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020085 - name: SPRING_DATA_MONGODB_HOST
86 value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
87 - name: SPRING_DATA_MONGODB_PORT
88 value: "{{ .Values.mongo.service.internalPort }}"
89 - name: SPRING_DATA_MONGODB_DATABASE
90 value: {{ .Values.mongo.config.dbName }}
91 - name: ONAP_LCPCLOUDREGIONID
92 value: {{ .Values.config.openStackRegion }}
93 - name: ONAP_TENANTID
Sylvain Desbureaux33f83672018-06-01 14:28:39 +020094 value: {{ .Values.config.openStackVNFTenantId | quote }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020095 - name: ONAP_CLOUDOWNER
96 value: {{ .Values.config.cloudOwner }}
97 - name: NBI_URL
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010098 value: "https://nbi.{{ include "common.namespace" . }}:8443/nbi/api/v4"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020099 - name: SDC_HOST
Matthieu Geerebaert3dc70822019-11-06 16:57:49 +0100100 value: "https://sdc-be.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200101 - name: SDC_HEADER_ECOMPINSTANCEID
102 value: {{ .Values.config.ecompInstanceId }}
103 - name: SDC_HEADER_AUTHORIZATION
104 value: {{ .Values.sdc_authorization }}
105 - name: AAI_HOST
Eric Debeaub0307652018-05-22 06:43:39 +0000106 value: "https://aai.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200107 - name: AAI_HEADER_AUTHORIZATION
108 value: {{ .Values.aai_authorization }}
109 - name: SO_HOST
110 value: http://so.{{ include "common.namespace" . }}:8080
111 {{- if .Values.so_authorization }}
112 - name: SO_HEADER_AUTHORIZATION
113 value: {{ .Values.so_authorization }}
114 {{- end }}
aosull014a119552019-03-14 15:15:49 +0000115 - name: DMAAP_HOST
aosull0125de8362020-04-09 11:05:30 +0100116 value: "https://message-router.{{ include "common.namespace" . }}:3905"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200117 - name: LOGGING_LEVEL_ORG_ONAP_NBI
118 value: {{ .Values.config.loglevel }}
Quoc Nghia Nguyendd0b3652018-09-17 22:28:28 +0200119 - name: MSB_ENABLED
120 value: "true"
121 - name: MSB_DISCOVERY_HOST
122 value: "msb-discovery.{{ include "common.namespace" . }}"
123 - name: MSB_DISCOVERY_PORT
124 value: "10081"
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100125 volumeMounts: {{ include "common.aaf-config-volume-mountpath" . | nindent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200126 - mountPath: /etc/localtime
127 name: localtime
128 readOnly: true
129 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000130{{ include "common.resources" . | indent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200131 {{- if .Values.nodeSelector }}
132 nodeSelector:
133{{ toYaml .Values.nodeSelector | indent 10 }}
134 {{- end -}}
135 {{- if .Values.affinity }}
136 affinity:
137{{ toYaml .Values.affinity | indent 10 }}
138 {{- end }}
139 # side car containers
140 # - name: filebeat-onap
141 # image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
142 # imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
143 # volumeMounts:
144 # - mountPath: /usr/share/filebeat/filebeat.yml
145 # name: filebeat-conf
146 # subPath: filebeat.yml
147 # - mountPath: /home/esr/works/logs
148 # name: esr-server-logs
149 # - mountPath: /usr/share/filebeat/data
150 # name: esr-server-filebeat
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100151 volumes: {{ include "common.aaf-config-volumes" . | nindent 8 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200152 - name: localtime
153 hostPath:
154 path: /etc/localtime
155 # - name: filebeat-conf
156 # configMap:
157 # name: {{ include "common.fullname" . }}-esr-filebeat
158 # - name: esr-server-logs
159 # emptyDir: {}
160 # - name: esr-server-filebeat
161 # emptyDir: {}
162 # - name: esrserver-log
163 # configMap:
164 # name: {{ include "common.fullname" . }}-esr-esrserver-log
165 imagePullSecrets:
166 - name: "{{ include "common.namespace" . }}-docker-registry-key"