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 }}
114 {{ if .Values.config.sdnr.oauth.enabled }}
115 - name: OAUTH_TOKEN_SECRET
116 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oauth-token-secret" "key" "password") | indent 10 }}
117 - name: KEYCLOAK_SECRET
118 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keycloak-secret" "key" "password") | indent 10 }}
120 - name: ENABLE_ODLUX_RBAC
121 value: "{{ .Values.config.sdnr.oauth.odluxRbac.enabled | default "true" }}"
126 - mountPath: /config-input
130 image: {{ include "repositoryGenerator.image.envsubst" . }}
131 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
132 name: {{ include "common.name" . }}-update-config
133 {{ if .Values.dgbuilder.enabled -}}
137 {{ if or .Values.dgbuilder.enabled .Values.config.sdnr.enabled -}}
139 - {{ include "common.mariadbService" . }}
141 - {{ include "common.fullname" . }}-dbinit-job
143 {{ if .Values.config.sdnr.enabled -}}
145 - {{ include "common.name" . }}-sdnrdb-init-job
152 fieldPath: metadata.namespace
153 image: {{ include "repositoryGenerator.image.readiness" . }}
154 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
155 name: {{ include "common.name" . }}-readiness
157 {{ include "common.certInitializer.initContainer" . | indent 6 }}
158 {{ include "common.certServiceClient.initContainer" . | indent 6 }}
159 - name: {{ include "common.name" . }}-chown
160 image: {{ include "repositoryGenerator.image.busybox" . }}
166 mkdir {{ .Values.persistence.mdsalPath }}/journal
167 mkdir {{ .Values.persistence.mdsalPath }}/snapshots
168 mkdir {{ .Values.persistence.mdsalPath }}/daexim
169 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
170 {{- if .Values.global.aafEnabled }}
171 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certInitializer.credsPath }}
174 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
175 - mountPath: {{ .Values.persistence.mdsalPath }}
176 name: {{ include "common.fullname" . }}-data
178 - name: {{ include "common.name" . }}
179 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
180 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
181 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
182 {{- $linkCommand := include "common.certManager.linkVolumeMounts" . }}
186 command: ["sh", "-c", {{$linkCommand | quote}} ]
188 command: ["/bin/bash"]
189 args: ["-c", "/opt/onap/sdnc/bin/createLinks.sh ; /opt/onap/sdnc/bin/startODL.sh"]
191 - containerPort: {{ .Values.service.internalPort }}
192 - containerPort: {{ .Values.service.internalPort2 }}
193 - containerPort: {{ .Values.service.internalPort3 }}
194 - containerPort: {{ .Values.service.clusterPort }}
197 port: {{ .Values.service.internalPort }}
198 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
199 periodSeconds: {{ .Values.readiness.periodSeconds }}
201 - name: MYSQL_ROOT_PASSWORD
202 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
203 - name: ODL_ADMIN_USERNAME
204 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
206 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
207 - name: ODL_ADMIN_PASSWORD
208 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
210 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
212 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
213 - name: SDNC_DB_PASSWORD
214 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
216 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
217 - name: MYSQL_PASSWORD
218 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
219 - name: MYSQL_DATABASE
220 value: "{{ .Values.config.dbSdnctlDatabase }}"
221 - name: SDNC_CONFIG_DIR
222 value: "{{ .Values.config.configDir }}"
223 - name: AAI_CLIENT_NAME
224 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 12 }}
225 - name: AAI_CLIENT_PASSWORD
226 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 12 }}
227 - name: AAI_TRUSTSTORE_PASSWORD
228 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-truststore-password" "key" "password") | indent 12 }}
229 - name: ANSIBLE_TRUSTSTORE_PASSWORD
230 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-truststore-password" "key" "password") | indent 12 }}
232 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "login") | indent 12 }}
234 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "password") | indent 12 }}
236 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "login") | indent 12 }}
237 - name: NENG_PASSWORD
238 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "password") | indent 12 }}
240 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "login") | indent 12 }}
242 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "password") | indent 12 }}
243 - name: HONEYCOMB_USER
244 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "login") | indent 12 }}
245 - name: HONEYCOMB_PASSWORD
246 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "password") | indent 12 }}
247 - name: TRUSTSTORE_PASSWORD
248 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 12 }}
249 - name: KEYSTORE_PASSWORD
250 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 12 }}
252 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "login") | indent 12 }}
253 - name: DMAAP_PASSWORD
254 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "password") | indent 12 }}
255 - name: DMAAP_AUTHKEY
256 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-authkey" "key" "password") | indent 12 }}
257 - name: ENABLE_ODL_CLUSTER
258 value: "{{ .Values.config.enableClustering }}"
259 - name: MY_ODL_CLUSTER
260 value: "{{ .Values.config.myODLCluster }}"
261 - name: PEER_ODL_CLUSTER
262 value: "{{ .Values.config.peerODLCluster }}"
263 - name: IS_PRIMARY_CLUSTER
264 value: "{{ .Values.config.isPrimaryCluster }}"
266 value: "{{ .Values.config.geoEnabled}}"
267 - name: SDNC_AAF_ENABLED
268 value: "{{ .Values.global.aafEnabled}}"
269 - name: SDNC_REPLICAS
270 value: "{{ .Values.replicaCount }}"
272 value: {{ include "common.mariadbService" . }}
274 value: {{ .Values.persistence.mdsalPath }}
276 value: {{ .Values.persistence.daeximPath }}
278 value: {{ .Values.persistence.journalPath }}
279 - name: SNAPSHOTS_PATH
280 value: {{ .Values.persistence.snapshotsPath }}
282 value: "{{ .Values.config.javaHome}}"
284 value: "-Xms{{.Values.config.odl.javaOptions.minMemory}} -Xmx{{.Values.config.odl.javaOptions.maxMemory}}"
285 - name: KARAF_CONSOLE_LOG_LEVEL
286 value: "{{ include "common.log.level" . }}"
288 value: "{{ .Values.config.sdnr.enabled | default "false"}}"
289 {{- if eq .Values.config.sdnr.mode "web" }}
294 value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
296 {{- $prefix := ternary "https" "http" .Values.global.aafEnabled}}
297 value: "{{$prefix}}://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
298 {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
299 - name: SDNRDBTRUSTALLCERTS
302 {{- if .Values.global.cmpv2Enabled }}
304 value: {{ (mustFirst (.Values.certificates)).mountPath }}
307 value: "{{ .Values.config.sdnr.oauth.enabled | default "false" }}"
309 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
310 {{ include "common.certServiceClient.volumeMounts" . | indent 10 }}
311 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
312 {{ include "common.certManager.volumeMounts" . | indent 10 }}
314 - mountPath: /etc/localtime
317 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
318 name: sdnc-logging-cfg-config
319 subPath: org.ops4j.pax.logging.cfg
320 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
322 subPath: installSdncDb.sh
323 - mountPath: {{ .Values.config.binDir }}/createLinks.sh
325 subPath: createLinks.sh
326 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
328 subPath: aaiclient.properties
329 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
331 subPath: aaiclient.properties
332 - mountPath: {{ .Values.config.configDir }}/dblib.properties
334 subPath: dblib.properties
335 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
337 subPath: lcm-dg.properties
338 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
340 subPath: svclogic.properties
341 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
343 subPath: svclogic.properties
344 - mountPath: {{ .Values.config.configDir }}/netbox.properties
346 subPath: netbox.properties
347 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
349 subPath: blueprints-processor-adaptor.properties
350 - mountPath: {{ .Values.persistence.mdsalPath }}
351 name: {{ include "common.fullname" . }}-data
352 - mountPath: /var/log/onap
354 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
357 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
359 subPath: org.opendaylight.controller.cluster.datastore.cfg
360 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.aaa.filterchain.cfg
362 subPath: org.opendaylight.aaa.filterchain.cfg
363 - mountPath: {{ .Values.config.odl.binDir }}/setenv
366 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-registrar.properties
368 subPath: mountpoint-registrar.properties
369 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
371 subPath: mountpoint-state-provider.properties
372 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.daexim.cfg
374 subPath: org.opendaylight.daexim.cfg
375 {{- if .Values.config.sdnr.oauth.enabled }}
376 - mountPath: {{ .Values.config.odl.etcDir }}/oauth-provider.config.json
378 subPath: oauth-provider.config.json
381 {{ include "common.resources" . | indent 12 }}
382 {{- if .Values.nodeSelector }}
384 {{ toYaml .Values.nodeSelector | indent 10 }}
386 {{- if .Values.affinity }}
388 {{ toYaml .Values.affinity | indent 10 }}
391 # side car containers
392 - name: filebeat-onap
393 image: {{ include "repositoryGenerator.image.logging" . }}
394 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
396 - mountPath: /usr/share/filebeat/filebeat.yml
398 subPath: filebeat.yml
399 - mountPath: /var/log/onap
401 - mountPath: /usr/share/filebeat/data
404 - name: "{{ include "common.namespace" . }}-docker-registry-key"
411 - name: data-filebeat
413 - name: filebeat-conf
415 name: {{ include "common.fullname" . }}-filebeat-configmap
416 - name: sdnc-logging-cfg-config
418 name: {{ include "common.fullname" . }}-log-configmap
421 name: {{ include "common.fullname" . }}-bin
425 name: {{ include "common.fullname" . }}-properties
430 {{ if not .Values.persistence.enabled }}
431 - name: {{ include "common.fullname" . }}-data
434 {{ include "common.certInitializer.volumes" . | nindent 8 }}
435 {{ include "common.certServiceClient.volumes" . | nindent 8 }}
436 {{- if and .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }}
437 {{ include "common.certManager.volumes" . | nindent 8 }}
439 volumeClaimTemplates:
441 name: {{ include "common.fullname" . }}-data
443 name: {{ include "common.fullname" . }}
444 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
445 release: "{{ include "common.release" . }}"
446 heritage: "{{ .Release.Service }}"
449 - {{ .Values.persistence.accessMode }}
450 storageClassName: {{ include "common.storageClass" . }}
453 storage: {{ .Values.persistence.size }}