Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / nbi / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Orange
3 # Modifications Copyright © 2018  Amdocs, Bell Canada
4 # Modifications Copyright © 2020 Nokia
5 #
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.
17 */}}
18
19 apiVersion: apps/v1
20 kind: Deployment
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
22 spec:
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   replicas: {{ .Values.replicaCount }}
25   template:
26     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
27     spec:
28       containers:
29         - name: {{ include "common.name" . }}
30           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
31           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
32           ports: {{ include "common.containerPorts" . | nindent 12 }}
33           # disable liveness probe when breakpoints set in debugger
34           # so K8s doesn't restart unresponsive container
35           {{ if .Values.liveness.enabled }}
36           livenessProbe:
37             httpGet:
38               port: {{ .Values.service.internalPort }}
39               path: {{ .Values.liveness.path }}
40               scheme: HTTP
41             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
42             periodSeconds: {{ .Values.liveness.periodSeconds }}
43           {{ end }}
44           readinessProbe:
45             httpGet:
46               port: {{ .Values.service.internalPort }}
47               path: {{ .Values.readiness.path }}
48               scheme: HTTP
49             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
50             periodSeconds: {{ .Values.readiness.periodSeconds }}
51           env:
52             - name: SPRING_DATASOURCE_URL
53               value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "db" "name" }}
54             - name: SPRING_DATASOURCE_USERNAME
55               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
56             - name: SPRING_DATASOURCE_PASSWORD
57               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
58             - name: SPRING_DATA_MONGODB_HOST
59               value: {{ .Values.mongodb.service.nameOverride }}.{{ include "common.namespace" . }}
60             - name: SPRING_DATA_MONGODB_PORT
61               value: "{{ .Values.mongodb.service.port }}"
62             - name: SPRING_DATA_MONGODB_DATABASE
63               value: {{ .Values.mongodb.config.dbName }}
64             - name: ONAP_LCPCLOUDREGIONID
65               value: {{ .Values.config.openStackRegion }}
66             - name: ONAP_TENANTID
67               value: {{ .Values.config.openStackVNFTenantId | quote }}
68             - name: ONAP_CLOUDOWNER
69               value: {{ .Values.config.cloudOwner }}
70             - name: ONAP_K8SCLOUDREGIONID
71               value: {{ .Values.config.k8sCloudRegionId }}
72             - name: ONAP_K8SCLOUDOWNER
73               value: {{ .Values.config.k8sCloudOwner }}
74             - name: NBI_URL
75               value: "http://nbi.{{ include "common.namespace" . }}:{{ .Values.service.internalPort }}/nbi/api/v4"
76             - name: SDC_HOST
77               value: "http://sdc-be.{{ include "common.namespace" . }}:8080"
78             - name: SDC_HEADER_ECOMPINSTANCEID
79               value: {{ .Values.config.ecompInstanceId }}
80             - name: SDC_HEADER_AUTHORIZATION
81               value: {{ .Values.sdc_authorization }}
82             - name: AAI_HOST
83               value: "http://aai.{{ include "common.namespace" . }}:80"
84             - name: AAI_HEADER_AUTHORIZATION
85               value: {{ .Values.aai_authorization }}
86             - name: SO_HOST
87               value: http://so.{{ include "common.namespace" . }}:8080
88             {{- if .Values.so_authorization }}
89             - name: SO_HEADER_AUTHORIZATION
90               value: {{ .Values.so_authorization }}
91             {{- end }}
92             - name: DMAAP_HOST
93               value: "http://message-router.{{ include "common.namespace" . }}:3904"
94             - name: LOGGING_LEVEL_ORG_ONAP_NBI
95               value: {{ .Values.config.loglevel }}
96             - name: MSB_ENABLED
97               value: "{{ .Values.global.msbEnabled }}"
98             - name: MSB_DISCOVERY_HOST
99               value: "msb-discovery.{{ include "common.namespace" . }}"
100             - name: MSB_DISCOVERY_PORT
101               value: "10081"
102           resources: {{ include "common.resources" . | nindent 12 }}
103         {{- if .Values.nodeSelector }}
104         nodeSelector:
105 {{ toYaml .Values.nodeSelector | indent 10 }}
106         {{- end -}}
107         {{- if .Values.affinity }}
108         affinity:
109 {{ toYaml .Values.affinity | indent 10 }}
110         {{- end }}
111       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
112       {{- include "common.imagePullSecrets" . | nindent 6 }}