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: AAI_TRUSTSTORE_PASSWORD
45 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-truststore-password" "key" "password") | indent 10 }}
46 - name: ANSIBLE_TRUSTSTORE_PASSWORD
47 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-truststore-password" "key" "password") | indent 10 }}
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "login") | indent 10 }}
51 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "password") | indent 10 }}
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "login") | indent 10 }}
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "password") | indent 10 }}
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "login") | indent 10 }}
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "password") | indent 10 }}
60 - name: HONEYCOMB_USER
61 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "login") | indent 10 }}
62 - name: HONEYCOMB_PASSWORD
63 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "password") | indent 10 }}
64 - name: TRUSTSTORE_PASSWORD
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 10 }}
66 - name: KEYSTORE_PASSWORD
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }}
69 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "login") | indent 10 }}
70 - name: DMAAP_PASSWORD
71 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "password") | indent 10 }}
73 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-authkey" "key" "password") | indent 10 }}
74 - name: MODELSERVICE_USER
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
76 - name: MODELSERVICE_PASSWORD
77 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
79 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
80 - name: RESTCONF_PASSWORD
81 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
83 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
84 - name: ANSIBLE_PASSWORD
85 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
87 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
88 - name: SCALEOUT_PASSWORD
89 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
91 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
93 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
94 - name: SDNC_DB_PASSWORD
95 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
97 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
98 - name: MYSQL_PASSWORD
99 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
100 - name: ODL_ADMIN_USERNAME
101 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
103 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
104 - name: ODL_ADMIN_PASSWORD
105 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
107 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
108 {{ if and .Values.config.sdnr.dmaapProxy.enabled .Values.config.sdnr.dmaapProxy.usepwd }}
109 - name: DMAAP_HTTP_PROXY_USERNAME
110 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-proxy-creds" "key" "login") | indent 10 }}
111 - name: DMAAP_HTTP_PROXY_PASSWORD
112 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-proxy-creds" "key" "password") | indent 10 }}
117 - mountPath: /config-input
121 image: {{ include "repositoryGenerator.image.envsubst" . }}
122 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
123 name: {{ include "common.name" . }}-update-config
124 {{ if .Values.dgbuilder.enabled -}}
128 {{ if or .Values.dgbuilder.enabled .Values.config.sdnr.enabled -}}
130 - {{ include "common.mariadbService" . }}
132 {{ if .Values.config.sdnr.enabled -}}
134 - {{ include "common.name" . }}-sdnrdb-init-job
141 fieldPath: metadata.namespace
142 image: {{ include "repositoryGenerator.image.readiness" . }}
143 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
144 name: {{ include "common.name" . }}-readiness
146 {{ include "common.certInitializer.initContainer" . | indent 6 }}
147 {{ include "common.certServiceClient.initContainer" . | indent 6 }}
148 - name: {{ include "common.name" . }}-chown
149 image: {{ include "repositoryGenerator.image.busybox" . }}
155 mkdir {{ .Values.persistence.mdsalPath }}/journal
156 mkdir {{ .Values.persistence.mdsalPath }}/snapshots
157 mkdir {{ .Values.persistence.mdsalPath }}/daexim
158 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
159 {{- if .Values.global.aafEnabled }}
160 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certInitializer.credsPath }}
163 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
164 - mountPath: {{ .Values.persistence.mdsalPath }}
165 name: {{ include "common.fullname" . }}-data
167 - name: {{ include "common.name" . }}
168 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
169 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
170 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
171 {{- $linkCommand := include "common.certManager.linkVolumeMounts" . }}
175 command: ["sh", "-c", {{$linkCommand | quote}} ]
177 command: ["/bin/bash"]
178 args: ["-c", "/opt/onap/sdnc/bin/createLinks.sh ; /opt/onap/sdnc/bin/startODL.sh"]
180 - containerPort: {{ .Values.service.internalPort }}
181 - containerPort: {{ .Values.service.internalPort2 }}
182 - containerPort: {{ .Values.service.internalPort3 }}
183 - containerPort: {{ .Values.service.clusterPort }}
186 port: {{ .Values.service.internalPort }}
187 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
188 periodSeconds: {{ .Values.readiness.periodSeconds }}
190 - name: MYSQL_ROOT_PASSWORD
191 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
192 - name: ODL_ADMIN_USERNAME
193 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
195 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
196 - name: ODL_ADMIN_PASSWORD
197 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
199 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
201 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
202 - name: SDNC_DB_PASSWORD
203 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
205 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
206 - name: MYSQL_PASSWORD
207 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
208 - name: MYSQL_DATABASE
209 value: "{{ .Values.config.dbSdnctlDatabase }}"
210 - name: SDNC_CONFIG_DIR
211 value: "{{ .Values.config.configDir }}"
212 - name: AAI_CLIENT_NAME
213 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 12 }}
214 - name: AAI_CLIENT_PASSWORD
215 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 12 }}
216 - name: AAI_TRUSTSTORE_PASSWORD
217 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-truststore-password" "key" "password") | indent 12 }}
218 - name: ANSIBLE_TRUSTSTORE_PASSWORD
219 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-truststore-password" "key" "password") | indent 12 }}
221 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "login") | indent 12 }}
223 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "password") | indent 12 }}
225 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "login") | indent 12 }}
226 - name: NENG_PASSWORD
227 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "password") | indent 12 }}
229 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "login") | indent 12 }}
231 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "password") | indent 12 }}
232 - name: HONEYCOMB_USER
233 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "login") | indent 12 }}
234 - name: HONEYCOMB_PASSWORD
235 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "password") | indent 12 }}
236 - name: TRUSTSTORE_PASSWORD
237 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 12 }}
238 - name: KEYSTORE_PASSWORD
239 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 12 }}
241 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "login") | indent 12 }}
242 - name: DMAAP_PASSWORD
243 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "password") | indent 12 }}
244 - name: DMAAP_AUTHKEY
245 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-authkey" "key" "password") | indent 12 }}
246 - name: ENABLE_ODL_CLUSTER
247 value: "{{ .Values.config.enableClustering }}"
248 - name: MY_ODL_CLUSTER
249 value: "{{ .Values.config.myODLCluster }}"
250 - name: PEER_ODL_CLUSTER
251 value: "{{ .Values.config.peerODLCluster }}"
252 - name: IS_PRIMARY_CLUSTER
253 value: "{{ .Values.config.isPrimaryCluster }}"
255 value: "{{ .Values.config.geoEnabled}}"
256 - name: SDNC_AAF_ENABLED
257 value: "{{ .Values.global.aafEnabled}}"
258 - name: SDNC_REPLICAS
259 value: "{{ .Values.replicaCount }}"
261 value: {{ include "common.mariadbService" . }}
263 value: {{ .Values.persistence.mdsalPath }}
265 value: {{ .Values.persistence.daeximPath }}
267 value: {{ .Values.persistence.journalPath }}
268 - name: SNAPSHOTS_PATH
269 value: {{ .Values.persistence.snapshotsPath }}
271 value: "{{ .Values.config.javaHome}}"
273 value: "-Xms{{.Values.config.odl.javaOptions.minMemory}} -Xmx{{.Values.config.odl.javaOptions.maxMemory}}"
274 - name: KARAF_CONSOLE_LOG_LEVEL
275 value: "{{ include "common.log.level" . }}"
277 value: "{{ .Values.config.sdnr.enabled | default "false"}}"
278 {{- if eq .Values.config.sdnr.mode "web" }}
283 value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
285 {{- $prefix := ternary "https" "http" .Values.global.aafEnabled}}
286 value: "{{$prefix}}://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
287 {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
288 - name: SDNRDBTRUSTALLCERTS
291 {{- if .Values.global.cmpv2Enabled }}
293 value: {{ (mustFirst (.Values.certificates)).mountPath }}
297 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
298 {{ include "common.certServiceClient.volumeMounts" . | indent 10 }}
299 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
300 {{ include "common.certManager.volumeMounts" . | indent 10 }}
302 - mountPath: /etc/localtime
305 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
306 name: sdnc-logging-cfg-config
307 subPath: org.ops4j.pax.logging.cfg
308 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
310 subPath: installSdncDb.sh
311 - mountPath: {{ .Values.config.binDir }}/createLinks.sh
313 subPath: createLinks.sh
314 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
316 subPath: aaiclient.properties
317 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
319 subPath: aaiclient.properties
320 - mountPath: {{ .Values.config.configDir }}/dblib.properties
322 subPath: dblib.properties
323 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
325 subPath: lcm-dg.properties
326 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
328 subPath: svclogic.properties
329 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
331 subPath: svclogic.properties
332 - mountPath: {{ .Values.config.configDir }}/netbox.properties
334 subPath: netbox.properties
335 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
337 subPath: blueprints-processor-adaptor.properties
338 - mountPath: {{ .Values.persistence.mdsalPath }}
339 name: {{ include "common.fullname" . }}-data
340 - mountPath: /var/log/onap
342 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
345 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
347 subPath: org.opendaylight.controller.cluster.datastore.cfg
348 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.aaa.filterchain.cfg
350 subPath: org.opendaylight.aaa.filterchain.cfg
351 - mountPath: {{ .Values.config.odl.binDir }}/setenv
354 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-registrar.properties
356 subPath: mountpoint-registrar.properties
357 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
359 subPath: mountpoint-state-provider.properties
360 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.daexim.cfg
362 subPath: org.opendaylight.daexim.cfg
364 {{ include "common.resources" . | indent 12 }}
365 {{- if .Values.nodeSelector }}
367 {{ toYaml .Values.nodeSelector | indent 10 }}
369 {{- if .Values.affinity }}
371 {{ toYaml .Values.affinity | indent 10 }}
374 # side car containers
375 - name: filebeat-onap
376 image: {{ include "repositoryGenerator.image.logging" . }}
377 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
379 - mountPath: /usr/share/filebeat/filebeat.yml
381 subPath: filebeat.yml
382 - mountPath: /var/log/onap
384 - mountPath: /usr/share/filebeat/data
387 - name: "{{ include "common.namespace" . }}-docker-registry-key"
394 - name: data-filebeat
396 - name: filebeat-conf
398 name: {{ include "common.fullname" . }}-filebeat-configmap
399 - name: sdnc-logging-cfg-config
401 name: {{ include "common.fullname" . }}-log-configmap
404 name: {{ include "common.fullname" . }}-bin
408 name: {{ include "common.fullname" . }}-properties
413 {{ if not .Values.persistence.enabled }}
414 - name: {{ include "common.fullname" . }}-data
417 {{ include "common.certInitializer.volumes" . | nindent 8 }}
418 {{ include "common.certServiceClient.volumes" . | nindent 8 }}
419 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
420 {{ include "common.certManager.volumes" . | nindent 8 }}
422 volumeClaimTemplates:
424 name: {{ include "common.fullname" . }}-data
426 name: {{ include "common.fullname" . }}
427 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
428 release: "{{ include "common.release" . }}"
429 heritage: "{{ .Release.Service }}"
432 - {{ .Values.persistence.accessMode }}
433 storageClassName: {{ include "common.storageClass" . }}
436 storage: {{ .Values.persistence.size }}