2 # Copyright © 2020 Samsung Electronics
3 # Copyright © 2017 Amdocs, Bell Canada
4 # Copyright © 2021 Nokia
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
25 app: {{ include "common.name" . }}
26 serviceName: {{ include "common.servicename" . }}-cluster
27 replicas: {{ .Values.replicaCount }}
28 selector: {{- include "common.selectors" . | nindent 4 }}
29 podManagementPolicy: Parallel
31 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
38 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
40 - name: AAI_CLIENT_NAME
41 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
42 - name: AAI_CLIENT_PASSWORD
43 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
44 - name: MODELSERVICE_USER
45 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
46 - name: MODELSERVICE_PASSWORD
47 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
50 - name: RESTCONF_PASSWORD
51 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
54 - name: ANSIBLE_PASSWORD
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
58 - name: SCALEOUT_PASSWORD
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
61 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
63 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
64 - name: SDNC_DB_PASSWORD
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
66 - name: ODL_ADMIN_USERNAME
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
68 - name: ODL_ADMIN_PASSWORD
69 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
70 {{ if and .Values.config.sdnr.dmaapProxy.enabled .Values.config.sdnr.dmaapProxy.usepwd }}
71 - name: DMAAP_HTTP_PROXY_USERNAME
72 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-proxy-creds" "key" "login") | indent 10 }}
73 - name: DMAAP_HTTP_PROXY_PASSWORD
74 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-proxy-creds" "key" "password") | indent 10 }}
79 - mountPath: /config-input
83 image: {{ include "repositoryGenerator.image.envsubst" . }}
84 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 name: {{ include "common.name" . }}-update-config
86 {{ if .Values.dgbuilder.enabled -}}
90 {{ if or .Values.dgbuilder.enabled .Values.config.sdnr.enabled -}}
92 - {{ include "common.mariadbService" . }}
94 {{ if .Values.config.sdnr.enabled -}}
96 - {{ include "common.name" . }}-sdnrdb-init-job
103 fieldPath: metadata.namespace
104 image: {{ include "repositoryGenerator.image.readiness" . }}
105 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
106 name: {{ include "common.name" . }}-readiness
108 {{ include "common.certInitializer.initContainer" . | indent 6 }}
109 {{ include "common.certServiceClient.initContainer" . | indent 6 }}
110 - name: {{ include "common.name" . }}-chown
111 image: {{ include "repositoryGenerator.image.busybox" . }}
117 mkdir {{ .Values.persistence.mdsalPath }}/journal
118 mkdir {{ .Values.persistence.mdsalPath }}/snapshots
119 mkdir {{ .Values.persistence.mdsalPath }}/daexim
120 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
121 {{- if .Values.global.aafEnabled }}
122 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certInitializer.credsPath }}
125 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
126 - mountPath: {{ .Values.persistence.mdsalPath }}
127 name: {{ include "common.fullname" . }}-data
129 - name: {{ include "common.name" . }}
130 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
131 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
132 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
133 {{- $linkCommand := include "common.certManager.linkVolumeMounts" . }}
137 command: ["sh", "-c", {{$linkCommand | quote}} ]
139 command: ["/bin/bash"]
140 args: ["-c", "/opt/onap/sdnc/bin/createLinks.sh ; /opt/onap/sdnc/bin/startODL.sh"]
142 - containerPort: {{ .Values.service.internalPort }}
143 - containerPort: {{ .Values.service.internalPort2 }}
144 - containerPort: {{ .Values.service.internalPort3 }}
145 - containerPort: {{ .Values.service.clusterPort }}
148 port: {{ .Values.service.internalPort }}
149 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
150 periodSeconds: {{ .Values.readiness.periodSeconds }}
152 - name: MYSQL_ROOT_PASSWORD
153 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
154 - name: ODL_ADMIN_USERNAME
155 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
156 - name: ODL_ADMIN_PASSWORD
157 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
159 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
160 - name: SDNC_DB_PASSWORD
161 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
162 - name: SDNC_CONFIG_DIR
163 value: "{{ .Values.config.configDir }}"
164 - name: ENABLE_ODL_CLUSTER
165 value: "{{ .Values.config.enableClustering }}"
166 - name: MY_ODL_CLUSTER
167 value: "{{ .Values.config.myODLCluster }}"
168 - name: PEER_ODL_CLUSTER
169 value: "{{ .Values.config.peerODLCluster }}"
170 - name: IS_PRIMARY_CLUSTER
171 value: "{{ .Values.config.isPrimaryCluster }}"
173 value: "{{ .Values.config.geoEnabled}}"
174 - name: SDNC_AAF_ENABLED
175 value: "{{ .Values.global.aafEnabled}}"
176 - name: SDNC_REPLICAS
177 value: "{{ .Values.replicaCount }}"
179 value: {{ include "common.mariadbService" . }}
181 value: {{ .Values.persistence.mdsalPath }}
183 value: {{ .Values.persistence.daeximPath }}
185 value: {{ .Values.persistence.journalPath }}
186 - name: SNAPSHOTS_PATH
187 value: {{ .Values.persistence.snapshotsPath }}
189 value: "{{ .Values.config.javaHome}}"
191 value: "-Xms{{.Values.config.odl.javaOptions.minMemory}} -Xmx{{.Values.config.odl.javaOptions.maxMemory}}"
192 - name: KARAF_CONSOLE_LOG_LEVEL
193 value: "{{ include "common.log.level" . }}"
195 value: "{{ .Values.config.sdnr.enabled | default "false"}}"
196 {{- if eq .Values.config.sdnr.mode "web" }}
201 value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
203 {{- $prefix := ternary "https" "http" .Values.global.aafEnabled}}
204 value: "{{$prefix}}://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
205 {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
206 - name: SDNRDBTRUSTALLCERTS
209 {{- if .Values.global.cmpv2Enabled }}
211 value: {{ (mustFirst (.Values.certificates)).mountPath }}
215 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
216 {{ include "common.certServiceClient.volumeMounts" . | indent 10 }}
217 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
218 {{ include "common.certManager.volumeMounts" . | indent 10 }}
220 - mountPath: /etc/localtime
223 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
224 name: sdnc-logging-cfg-config
225 subPath: org.ops4j.pax.logging.cfg
226 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
228 subPath: installSdncDb.sh
229 - mountPath: {{ .Values.config.binDir }}/createLinks.sh
231 subPath: createLinks.sh
232 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
234 subPath: aaiclient.properties
235 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
237 subPath: aaiclient.properties
238 - mountPath: {{ .Values.config.configDir }}/dblib.properties
240 subPath: dblib.properties
241 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
243 subPath: lcm-dg.properties
244 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
246 subPath: svclogic.properties
247 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
249 subPath: svclogic.properties
250 - mountPath: {{ .Values.config.configDir }}/netbox.properties
252 subPath: netbox.properties
253 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
255 subPath: blueprints-processor-adaptor.properties
256 - mountPath: {{ .Values.persistence.mdsalPath }}
257 name: {{ include "common.fullname" . }}-data
258 - mountPath: /var/log/onap
260 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
263 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
265 subPath: org.opendaylight.controller.cluster.datastore.cfg
266 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.aaa.filterchain.cfg
268 subPath: org.opendaylight.aaa.filterchain.cfg
269 - mountPath: {{ .Values.config.odl.binDir }}/setenv
272 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-registrar.properties
274 subPath: mountpoint-registrar.properties
275 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
277 subPath: mountpoint-state-provider.properties
278 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.daexim.cfg
280 subPath: org.opendaylight.daexim.cfg
282 {{ include "common.resources" . | indent 12 }}
283 {{- if .Values.nodeSelector }}
285 {{ toYaml .Values.nodeSelector | indent 10 }}
287 {{- if .Values.affinity }}
289 {{ toYaml .Values.affinity | indent 10 }}
292 # side car containers
293 - name: filebeat-onap
294 image: {{ include "repositoryGenerator.image.logging" . }}
295 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
297 - mountPath: /usr/share/filebeat/filebeat.yml
299 subPath: filebeat.yml
300 - mountPath: /var/log/onap
302 - mountPath: /usr/share/filebeat/data
305 - name: "{{ include "common.namespace" . }}-docker-registry-key"
312 - name: data-filebeat
314 - name: filebeat-conf
316 name: {{ include "common.fullname" . }}-filebeat-configmap
317 - name: sdnc-logging-cfg-config
319 name: {{ include "common.fullname" . }}-log-configmap
322 name: {{ include "common.fullname" . }}-bin
326 name: {{ include "common.fullname" . }}-properties
331 {{ if not .Values.persistence.enabled }}
332 - name: {{ include "common.fullname" . }}-data
335 {{ include "common.certInitializer.volumes" . | nindent 8 }}
336 {{ include "common.certServiceClient.volumes" . | nindent 8 }}
337 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
338 {{ include "common.certManager.volumes" . | nindent 8 }}
340 volumeClaimTemplates:
342 name: {{ include "common.fullname" . }}-data
344 name: {{ include "common.fullname" . }}
345 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
346 release: "{{ include "common.release" . }}"
347 heritage: "{{ .Release.Service }}"
350 - {{ .Values.persistence.accessMode }}
351 storageClassName: {{ include "common.storageClass" . }}
354 storage: {{ .Values.persistence.size }}