blob: 6a246a623c13c02711e70277fe564ad39911aea1 [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
Andreas Geisslerb19c8512022-10-13 13:15:29 +020021metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020022spec:
Andreas Geisslerb19c8512022-10-13 13:15:29 +020023 selector: {{- include "common.selectors" . | nindent 4 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020024 replicas: {{ .Values.replicaCount }}
25 template:
Andreas Geisslerb19c8512022-10-13 13:15:29 +020026 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020027 spec:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010028{{- if .Values.global.aafEnabled }}
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020029 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010030{{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020031 containers:
32 - name: {{ include "common.name" . }}
Sylvain Desbureauxe79bbc52020-11-21 22:06:57 +010033 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020034 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geisslerb19c8512022-10-13 13:15:29 +020035 ports: {{ include "common.containerPorts" . | nindent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020036 # disable liveness probe when breakpoints set in debugger
37 # so K8s doesn't restart unresponsive container
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010038 {{- if .Values.global.aafEnabled }}
39 command:
aosull01f7b781e2020-08-28 15:02:06 +010040 - sh
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010041 args:
42 - -c
43 - |
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020044 export $(grep '^c' {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010045 export JAVA_OPTS="-Djavax.net.ssl.trustStorePassword=$cadi_truststore_password \
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020046 -Dserver.ssl.key-store={{ .Values.certInitializer.credsPath }}/org.onap.nbi.p12 \
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010047 -Dserver.ssl.key-store-type=PKCS12 \
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +020048 -Djavax.net.ssl.trustStore={{ .Values.certInitializer.credsPath }}/org.onap.nbi.trust.jks \
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010049 -Dserver.ssl.key-store-password=$cadi_keystore_password_p12 \
50 -Djavax.net.ssl.trustStoreType=jks\
51 -Djava.security.egd=file:/dev/./urandom -Dserver.port=8443"
aosull0125de8362020-04-09 11:05:30 +010052 exec java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010053 {{- end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020054 {{ if .Values.liveness.enabled }}
55 livenessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010056 httpGet:
Andreas Geisslerb19c8512022-10-13 13:15:29 +020057 port: {{ if (include "common.needTLS" .) }}{{ .Values.service.internalPort }}{{ else }}{{ .Values.service.internalPlainPort }}{{ end }}
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010058 path: {{ .Values.liveness.path }}
Andreas Geisslerb19c8512022-10-13 13:15:29 +020059 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020060 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
61 periodSeconds: {{ .Values.liveness.periodSeconds }}
62 {{ end }}
63 readinessProbe:
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010064 httpGet:
Andreas Geisslerb19c8512022-10-13 13:15:29 +020065 port: {{ if (include "common.needTLS" .) }}{{ .Values.service.internalPort }}{{ else }}{{ .Values.service.internalPlainPort }}{{ end }}
Sylvain Desbureauxd82050c2020-03-17 10:43:40 +010066 path: {{ .Values.readiness.path }}
Andreas Geisslerb19c8512022-10-13 13:15:29 +020067 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020068 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.readiness.periodSeconds }}
70 env:
71 - name: SPRING_DATASOURCE_URL
Sylvain Desbureaux93a5b492020-11-27 11:07:42 +010072 value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "db" "name" }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020073 - name: SPRING_DATASOURCE_USERNAME
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010074 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020075 - name: SPRING_DATASOURCE_PASSWORD
Krzysztof Opasiak783fabf2020-03-24 03:26:45 +010076 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020077 - name: SPRING_DATA_MONGODB_HOST
78 value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
79 - name: SPRING_DATA_MONGODB_PORT
80 value: "{{ .Values.mongo.service.internalPort }}"
81 - name: SPRING_DATA_MONGODB_DATABASE
82 value: {{ .Values.mongo.config.dbName }}
83 - name: ONAP_LCPCLOUDREGIONID
84 value: {{ .Values.config.openStackRegion }}
85 - name: ONAP_TENANTID
Sylvain Desbureaux33f83672018-06-01 14:28:39 +020086 value: {{ .Values.config.openStackVNFTenantId | quote }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020087 - name: ONAP_CLOUDOWNER
88 value: {{ .Values.config.cloudOwner }}
aleemraja40149d82020-10-16 17:48:17 +053089 - name: ONAP_K8SCLOUDREGIONID
90 value: {{ .Values.config.k8sCloudRegionId }}
91 - name: ONAP_K8SCLOUDOWNER
92 value: {{ .Values.config.k8sCloudOwner }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020093 - name: NBI_URL
Andreas Geisslerb19c8512022-10-13 13:15:29 +020094 value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://nbi.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}{{ .Values.service.internalPort }}{{ else }}{{ .Values.service.internalPlainPort }}{{ end }}/nbi/api/v4"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020095 - name: SDC_HOST
Andreas Geisslerb19c8512022-10-13 13:15:29 +020096 value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://sdc-be.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}8443{{ else }}8080{{ end }}"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +020097 - name: SDC_HEADER_ECOMPINSTANCEID
98 value: {{ .Values.config.ecompInstanceId }}
99 - name: SDC_HEADER_AUTHORIZATION
100 value: {{ .Values.sdc_authorization }}
101 - name: AAI_HOST
Andreas Geisslerb19c8512022-10-13 13:15:29 +0200102 value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://aai.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}8443{{ else }}80{{ end }}"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200103 - name: AAI_HEADER_AUTHORIZATION
104 value: {{ .Values.aai_authorization }}
105 - name: SO_HOST
106 value: http://so.{{ include "common.namespace" . }}:8080
107 {{- if .Values.so_authorization }}
108 - name: SO_HEADER_AUTHORIZATION
109 value: {{ .Values.so_authorization }}
110 {{- end }}
aosull014a119552019-03-14 15:15:49 +0000111 - name: DMAAP_HOST
Andreas Geisslerb19c8512022-10-13 13:15:29 +0200112 value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}://message-router.{{ include "common.namespace" . }}:{{ if (include "common.needTLS" .) }}3905{{ else }}3904{{ end }}"
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200113 - name: LOGGING_LEVEL_ORG_ONAP_NBI
114 value: {{ .Values.config.loglevel }}
Quoc Nghia Nguyendd0b3652018-09-17 22:28:28 +0200115 - name: MSB_ENABLED
Andreas Geisslerb19c8512022-10-13 13:15:29 +0200116 value: "{{ .Values.global.msbEnabled }}"
Quoc Nghia Nguyendd0b3652018-09-17 22:28:28 +0200117 - name: MSB_DISCOVERY_HOST
118 value: "msb-discovery.{{ include "common.namespace" . }}"
119 - name: MSB_DISCOVERY_PORT
120 value: "10081"
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +0200121 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200122 - mountPath: /etc/localtime
123 name: localtime
124 readOnly: true
125 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000126{{ include "common.resources" . | indent 12 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200127 {{- if .Values.nodeSelector }}
128 nodeSelector:
129{{ toYaml .Values.nodeSelector | indent 10 }}
130 {{- end -}}
131 {{- if .Values.affinity }}
132 affinity:
133{{ toYaml .Values.affinity | indent 10 }}
134 {{- end }}
farida azmy37c98762021-10-18 13:06:52 +0200135 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Krzysztof Opasiak020cdb92020-05-01 01:46:37 +0200136 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200137 - name: localtime
138 hostPath:
139 path: /etc/localtime
Sylvain Desbureauxe44d1702018-05-07 20:39:16 +0200140 imagePullSecrets:
141 - name: "{{ include "common.namespace" . }}-docker-registry-key"