blob: 4be444ad1bcfc41669242f8f8f9ace0d8061ef24 [file] [log] [blame]
Jakub Latusek922465c2020-09-16 12:42:00 +02001{{/*
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +02002# Copyright © 2018 Orange
Prateekinlinux445a18e2018-08-01 06:48:33 +00003# Modifications Copyright © 2018 Amdocs, Bell Canada
Grzegorz-Lisb97c60a2020-07-29 12:36:06 +02004# Modifications Copyright © 2020 Nokia
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +02005#
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 Latusek922465c2020-09-16 12:42:00 +020017*/}}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020018
Grzegorz-Lisb97c60a2020-07-29 12:36:06 +020019apiVersion: apps/v1
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020020kind: 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" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020028 heritage: {{ .Release.Service }}
29spec:
Grzegorz-Lisb97c60a2020-07-29 12:36:06 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020033 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" . }}
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010039 name: {{ include "common.fullname" . }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020040 spec:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010041{{- if .Values.global.aafEnabled }}
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020042 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010043{{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020044 containers:
45 - name: {{ include "common.name" . }}
Sylvain Desbureauxe79bbc52020-11-21 22:06:57 +010046 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020047 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 ports:
49 - containerPort: {{ .Values.service.internalPort }}
50 # disable liveness probe when breakpoints set in debugger
51 # so K8s doesn't restart unresponsive container
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010052 {{- if .Values.global.aafEnabled }}
53 command:
aosull01f7b781e2020-08-28 15:02:06 +010054 - sh
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010055 args:
56 - -c
57 - |
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020058 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010059 export JAVA_OPTS="-Djavax.net.ssl.trustStorePassword=$cadi_truststore_password \
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020060 -Dserver.ssl.key-store={{ .Values.certInitializer.credsPath }}/org.onap.nbi.p12 \
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010061 -Dserver.ssl.key-store-type=PKCS12 \
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020062 -Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/org.onap.nbi.trust.jks \
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010063 -Dserver.ssl.key-store-password=$cadi_keystore_password_p12 \
64 -Djavax.net.ssl.trustStoreType=jks\
65 -Djava.security.egd=file:/dev/./urandom -Dserver.port=8443"
aosull0125de8362020-04-09 11:05:30 +010066 exec java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010067 {{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020068 {{ if .Values.liveness.enabled }}
69 livenessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010070 httpGet:
71 port: {{ .Values.liveness.port }}
72 path: {{ .Values.liveness.path }}
73 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020074 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
76 {{ end }}
77 readinessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010078 httpGet:
79 port: {{ .Values.readiness.port }}
80 path: {{ .Values.readiness.path }}
81 scheme: HTTPS
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020082 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
83 periodSeconds: {{ .Values.readiness.periodSeconds }}
84 env:
85 - name: SPRING_DATASOURCE_URL
Sylvain Desbureaux1d061a42019-11-08 15:27:20 +010086 value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020087 - name: SPRING_DATASOURCE_USERNAME
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010088 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020089 - name: SPRING_DATASOURCE_PASSWORD
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010090 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020091 - name: SPRING_DATA_MONGODB_HOST
92 value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
93 - name: SPRING_DATA_MONGODB_PORT
94 value: "{{ .Values.mongo.service.internalPort }}"
95 - name: SPRING_DATA_MONGODB_DATABASE
96 value: {{ .Values.mongo.config.dbName }}
97 - name: ONAP_LCPCLOUDREGIONID
98 value: {{ .Values.config.openStackRegion }}
99 - name: ONAP_TENANTID
Sylvain Desbureaux33f83672018-06-01 14:28:39 +0200100 value: {{ .Values.config.openStackVNFTenantId | quote }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200101 - name: ONAP_CLOUDOWNER
102 value: {{ .Values.config.cloudOwner }}
aleemraja40149d82020-10-16 17:48:17 +0530103 - name: ONAP_K8SCLOUDREGIONID
104 value: {{ .Values.config.k8sCloudRegionId }}
105 - name: ONAP_K8SCLOUDOWNER
106 value: {{ .Values.config.k8sCloudOwner }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200107 - name: NBI_URL
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +0100108 value: "https://nbi.{{ include "common.namespace" . }}:8443/nbi/api/v4"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200109 - name: SDC_HOST
Matthieu Geerebaert3dc70822019-11-06 16:57:49 +0100110 value: "https://sdc-be.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200111 - name: SDC_HEADER_ECOMPINSTANCEID
112 value: {{ .Values.config.ecompInstanceId }}
113 - name: SDC_HEADER_AUTHORIZATION
114 value: {{ .Values.sdc_authorization }}
115 - name: AAI_HOST
Eric Debeaub0307652018-05-22 06:43:39 +0000116 value: "https://aai.{{ include "common.namespace" . }}:8443"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200117 - name: AAI_HEADER_AUTHORIZATION
118 value: {{ .Values.aai_authorization }}
119 - name: SO_HOST
120 value: http://so.{{ include "common.namespace" . }}:8080
121 {{- if .Values.so_authorization }}
122 - name: SO_HEADER_AUTHORIZATION
123 value: {{ .Values.so_authorization }}
124 {{- end }}
aosull014a119552019-03-14 15:15:49 +0000125 - name: DMAAP_HOST
aosull0125de8362020-04-09 11:05:30 +0100126 value: "https://message-router.{{ include "common.namespace" . }}:3905"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200127 - name: LOGGING_LEVEL_ORG_ONAP_NBI
128 value: {{ .Values.config.loglevel }}
Quoc Nghia Nguyendd0b3652018-09-17 22:28:28 +0200129 - name: MSB_ENABLED
130 value: "true"
131 - name: MSB_DISCOVERY_HOST
132 value: "msb-discovery.{{ include "common.namespace" . }}"
133 - name: MSB_DISCOVERY_PORT
134 value: "10081"
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +0200135 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200136 - mountPath: /etc/localtime
137 name: localtime
138 readOnly: true
139 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000140{{ include "common.resources" . | indent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200141 {{- if .Values.nodeSelector }}
142 nodeSelector:
143{{ toYaml .Values.nodeSelector | indent 10 }}
144 {{- end -}}
145 {{- if .Values.affinity }}
146 affinity:
147{{ toYaml .Values.affinity | indent 10 }}
148 {{- end }}
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +0200149 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200150 - name: localtime
151 hostPath:
152 path: /etc/localtime
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200153 imagePullSecrets:
154 - name: "{{ include "common.namespace" . }}-docker-registry-key"