4607b62d46c11a0a1fdce4c88da89591c9ebfda5
[oom.git] / kubernetes / sdnc / templates / statefulset.yaml
1 {{/*
2 # Copyright © 2020 Samsung Electronics
3 # Copyright © 2017 Amdocs, Bell Canada
4 # Copyright © 2021 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: StatefulSet
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
22 spec:
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   serviceName: {{ include "common.servicename" . }}-cluster
25   podManagementPolicy: Parallel
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
29     spec:
30       initContainers:
31       - command:
32         - sh
33         args:
34         - -c
35         - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
36         env:
37         - name: AAI_CLIENT_NAME
38           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
39         - name: AAI_CLIENT_PASSWORD
40           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
41         - name: AAI_TRUSTSTORE_PASSWORD
42           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-truststore-password" "key" "password") | indent 10 }}
43         - name: ANSIBLE_TRUSTSTORE_PASSWORD
44           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-truststore-password" "key" "password") | indent 10 }}
45         - name: SO_USER
46           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "login") | indent 10 }}
47         - name: SO_PASSWORD
48           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "password") | indent 10 }}
49         - name: NENG_USER
50           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "login") | indent 10 }}
51         - name: NENG_PASSWORD
52           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "password") | indent 10 }}
53         - name: CDS_USER
54           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "login") | indent 10 }}
55         - name: CDS_PASSWORD
56           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "password") | indent 10 }}
57         - name: HONEYCOMB_USER
58           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "login") | indent 10 }}
59         - name: HONEYCOMB_PASSWORD
60           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "password") | indent 10 }}
61         - name: TRUSTSTORE_PASSWORD
62           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 10 }}
63         - name: KEYSTORE_PASSWORD
64           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }}
65         - name: DMAAP_USER
66           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "login") | indent 10 }}
67         - name: DMAAP_PASSWORD
68           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "password") | indent 10 }}
69         - name: DMAAP_AUTHKEY
70           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-authkey" "key" "password") | indent 10 }}
71         - name: MODELSERVICE_USER
72           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
73         - name: MODELSERVICE_PASSWORD
74           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
75         - name: RESTCONF_USER
76           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
77         - name: RESTCONF_PASSWORD
78           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
79         - name: ANSIBLE_USER
80           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
81         - name: ANSIBLE_PASSWORD
82           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
83         - name: SCALEOUT_USER
84           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
85         - name: SCALEOUT_PASSWORD
86           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
87         - name: NETBOX_APIKEY
88           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
89         - name: SDNC_DB_USER
90           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
91         - name: SDNC_DB_PASSWORD
92           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
93         - name: MYSQL_USER
94           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
95         - name: MYSQL_PASSWORD
96           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
97         - name: ODL_ADMIN_USERNAME
98           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
99         - name: ODL_USER
100           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
101         - name: ODL_ADMIN_PASSWORD
102           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
103         - name: ODL_PASSWORD
104           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
105         {{ if .Values.config.sdnr.oauth.enabled }}
106         - name: OAUTH_TOKEN_SECRET
107           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oauth-token-secret" "key" "password") | indent 10 }}
108         - name: KEYCLOAK_SECRET
109           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keycloak-secret" "key" "password") | indent 10 }}
110         - name: ENABLE_ODLUX_RBAC
111           value: "{{ .Values.config.sdnr.oauth.odluxRbac.enabled | default "true" }}"
112         {{ end }}
113         - name: SDNR_KAFKA_ENABLED
114           value: "{{ .Values.config.sdnr.kafka.enabled | default "false" }}"
115         {{ if .Values.config.sdnr.kafka.enabled }}
116         - name: SDNR_KAFKA_BOOTSTRAP_SERVERS
117           value: "{{ .Values.config.sdnr.kafka.bootstrapServers | default (include "common.release" .) }}-strimzi-kafka-bootstrap.{{.Release.Namespace}}:9092"
118         - name: SDNR_KAFKA_SECURITY_PROTOCOL
119           value: "{{ .Values.config.sdnr.kafka.securityProtocol | default "SASL_PLAINTEXT" }}"
120         - name: SDNR_KAFKA_SASL_MECHANISM
121           value: "{{ .Values.config.sdnr.kafka.saslMechanism | default "SCRAM-SHA-512" }}"
122         - name: SDNR_KAFKA_SASL_JASS_CONFIG
123           valueFrom:
124             secretKeyRef:
125               name: {{ include "common.name" . }}-ku
126               key: sasl.jaas.config
127         {{ end }}
128         volumeMounts:
129         - mountPath: /config-input
130           name: config-input
131         - mountPath: /config
132           name: properties
133         image: {{ include "repositoryGenerator.image.envsubst" . }}
134         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
135         name: {{ include "common.name" . }}-update-config
136       {{ if or .Values.dgbuilder.enabled .Values.config.sdnr.enabled -}}
137       - command:
138         - /app/ready.py
139         args:
140         {{ if .Values.dgbuilder.enabled -}}
141         - --app-name
142         - {{ include "common.mariadbAppName" . }}
143         - --job-name
144         - {{ include "common.fullname" . }}-dbinit-job
145         {{ end -}}
146         {{ if .Values.config.sdnr.enabled -}}
147         - --job-name
148         - {{ include "common.fullname" . }}-sdnrdb-init-job
149         {{ end -}}
150         env:
151         - name: NAMESPACE
152           valueFrom:
153             fieldRef:
154               apiVersion: v1
155               fieldPath: metadata.namespace
156         image: {{ include "repositoryGenerator.image.readiness" . }}
157         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
158         name: {{ include "common.name" . }}-readiness
159         {{ end }}
160       - name: {{ include "common.name" . }}-chown
161         image: {{ include "repositoryGenerator.image.busybox" . }}
162         command:
163         - sh
164         args:
165         - -c
166         - |
167            mkdir {{ .Values.persistence.mdsalPath }}/journal
168            mkdir {{ .Values.persistence.mdsalPath }}/snapshots
169            mkdir {{ .Values.persistence.mdsalPath }}/daexim
170            chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
171         volumeMounts:
172           - mountPath: {{ .Values.persistence.mdsalPath }}
173             name: {{ include "common.fullname" . }}-data
174       containers:
175         - name: {{ include "common.name" . }}
176           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
177           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
178           {{- if .Values.global.cmpv2Enabled }}
179           {{- $linkCommand := include "common.certManager.linkVolumeMounts" . }}
180           lifecycle:
181             postStart:
182               exec:
183                 command: ["sh", "-c", {{$linkCommand | quote}} ]
184           {{- end }}
185           command: ["/bin/bash"]
186           args: ["-c", "/opt/onap/sdnc/bin/createLinks.sh ; /opt/onap/sdnc/bin/startODL.sh"]
187           ports:
188           - containerPort: {{ .Values.service.internalPort }}
189           - containerPort: {{ .Values.service.internalPort2 }}
190           - containerPort: {{ .Values.service.internalPort3 }}
191           - containerPort: {{ .Values.service.clusterPort }}
192           {{- if .Values.config.sdnr.netconfCallHome.enabled }}
193           - containerPort: {{ .Values.service.callHomePort }}
194           {{- end }}
195           readinessProbe:
196             tcpSocket:
197               port: {{ .Values.service.internalPort }}
198             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
199             periodSeconds: {{ .Values.readiness.periodSeconds }}
200           env:
201           {{ if and .Values.config.sdnr.enabled .Values.config.sdnr.sdnronly -}}
202           - name: MYSQL_ROOT_PASSWORD
203             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
204           {{ end -}}
205           - name: ODL_ADMIN_USERNAME
206             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
207           - name: ODL_USER
208             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
209           - name: ODL_ADMIN_PASSWORD
210             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
211           - name: ODL_PASSWORD
212             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
213           - name: SDNC_DB_USER
214             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
215           - name: SDNC_DB_PASSWORD
216             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
217           - name: MYSQL_USER
218             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
219           - name: MYSQL_PASSWORD
220             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
221           - name: MYSQL_DATABASE
222             value: "{{ .Values.config.dbSdnctlDatabase }}"
223           - name: SDNC_CONFIG_DIR
224             value: "{{ .Values.config.configDir }}"
225           - name: AAI_CLIENT_NAME
226             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 12 }}
227           - name: AAI_CLIENT_PASSWORD
228             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 12 }}
229           - name: AAI_TRUSTSTORE_PASSWORD
230             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-truststore-password" "key" "password") | indent 12 }}
231           - name: ANSIBLE_TRUSTSTORE_PASSWORD
232             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-truststore-password" "key" "password") | indent 12 }}
233           - name: SO_USER
234             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "login") | indent 12 }}
235           - name: SO_PASSWORD
236             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-user-creds" "key" "password") | indent 12 }}
237           - name: NENG_USER
238             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "login") | indent 12 }}
239           - name: NENG_PASSWORD
240             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-user-creds" "key" "password") | indent 12 }}
241           - name: CDS_USER
242             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "login") | indent 12 }}
243           - name: CDS_PASSWORD
244             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-user-creds" "key" "password") | indent 12 }}
245           - name: HONEYCOMB_USER
246             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "login") | indent 12 }}
247           - name: HONEYCOMB_PASSWORD
248             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "honeycomb-user-creds" "key" "password") | indent 12 }}
249           - name: TRUSTSTORE_PASSWORD
250             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-password" "key" "password") | indent 12 }}
251           - name: KEYSTORE_PASSWORD
252             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-password" "key" "password") | indent 12 }}
253           - name: DMAAP_USER
254             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "login") | indent 12 }}
255           - name: DMAAP_PASSWORD
256             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-user-creds" "key" "password") | indent 12 }}
257           - name: DMAAP_AUTHKEY
258             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-authkey" "key" "password") | indent 12 }}
259           - name: ENABLE_ODL_CLUSTER
260             value: "{{ .Values.config.enableClustering }}"
261           - name: MY_ODL_CLUSTER
262             value: "{{ .Values.config.myODLCluster }}"
263           - name: PEER_ODL_CLUSTER
264             value: "{{ .Values.config.peerODLCluster }}"
265           - name: IS_PRIMARY_CLUSTER
266             value: "{{ .Values.config.isPrimaryCluster }}"
267           - name: GEO_ENABLED
268             value: "{{ .Values.config.geoEnabled}}"
269           - name: SDNC_AAF_ENABLED
270             value: "false"
271           - name: SDNC_REPLICAS
272             value: "{{ .Values.replicaCount }}"
273           - name: MYSQL_HOST
274             value: {{ include "common.mariadbService" . }}
275           - name: MDSAL_PATH
276             value: {{ .Values.persistence.mdsalPath }}
277           - name: DAEXIM_PATH
278             value: {{ .Values.persistence.daeximPath }}
279           - name: JOURNAL_PATH
280             value: {{ .Values.persistence.journalPath }}
281           - name: SNAPSHOTS_PATH
282             value: {{ .Values.persistence.snapshotsPath }}
283           - name: JAVA_HOME
284             value: "{{ .Values.config.javaHome}}"
285           - name: JAVA_OPTS
286             value: "-Xms{{.Values.config.odl.javaOptions.minMemory}} -Xmx{{.Values.config.odl.javaOptions.maxMemory}}"
287           - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
288             value: "true"
289           - name: KARAF_CONSOLE_LOG_LEVEL
290             value: "{{ include "common.log.level" . }}"
291           - name: SDNRWT
292             value: "{{ .Values.config.sdnr.enabled | default "false"}}"
293           {{- if eq .Values.config.sdnr.mode "web" }}
294           - name: SDNRDM
295             value: "true"
296           {{- end }}
297           - name: SDNRONLY
298             value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
299           {{- if .Values.config.sdnr.mariadb.enabled }}
300           - name: SDNRCONTROLLERID
301             value: {{ uuidv4 }}
302           - name: SDNRDBTYPE
303             value: MARIADB
304           - name: SDNRDBURL
305             value: "jdbc:mysql://{{ include "common.mariadbService" . }}:3306/{{ .Values.config.sdnr.mariadb.databaseName}}"
306           - name: SDNR_DB_DATABASE
307             value: {{ .Values.config.sdnr.mariadb.databaseName }}
308           - name: SDNRDBUSERNAME
309             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "login") | indent 12 }}
310           - name: SDNRDBPASSWORD
311             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnrdb-secret" "key" "password") | indent 12 }}
312           - name: SDNR_ASYNC_HANDLING
313             value: {{ .Values.config.sdnr.mariadb.asyncHandling | default "false" | quote }}
314           - name: SDNR_ASYNC_POOLSIZE
315             value: {{ .Values.config.sdnr.mariadb.asyncPoolSize | default 200 | quote }}
316           {{- else }}
317           - name: SDNRDBURL
318             value: "http://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
319           {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
320           - name: SDNRDBTRUSTALLCERTS
321             value: "true"
322           {{- end }}
323           {{- end }}
324           {{- if .Values.global.cmpv2Enabled }}
325           - name: ODL_CERT_DIR
326             value: {{ (mustFirst (.Values.certificates)).mountPath }}
327           {{- end }}
328           - name: ENABLE_OAUTH
329             value: "{{ .Values.config.sdnr.oauth.enabled | default "false" }}"
330           - name: SDNR_NETCONF_CALLHOME_ENABLED
331             value: "{{ .Values.config.sdnr.netconfCallHome.enabled | default "false" }}"
332           - name: SDNR_VES_COLLECTOR_ENABLED
333             value: "{{ .Values.config.sdnr.vesCollector.enabled }}"
334           - name: SDNR_VES_COLLECTOR_TLS_ENABLED
335             value: "{{ .Values.config.sdnr.vesCollector.tls.enabled }}"
336           - name: SDNR_VES_COLLECTOR_TRUST_ALL_CERTS
337             value: "{{ .Values.config.sdnr.vesCollector.trustAllCertificates }}"
338           - name: SDNR_VES_COLLECTOR_IP
339             value: "{{ .Values.config.sdnr.vesCollector.address }}"
340           - name: SDNR_VES_COLLECTOR_PORT
341             value: "{{ .Values.config.sdnr.vesCollector.port }}"
342           - name: SDNR_VES_COLLECTOR_VERSION
343             value: "{{ .Values.config.sdnr.vesCollector.version | default "v7" }}"
344           - name: SDNR_VES_COLLECTOR_REPORTING_ENTITY_NAME
345             value: "{{ .Values.config.sdnr.vesCollector.reportingEntityName | default "ONAP SDN-R" }}"
346           - name: SDNR_VES_COLLECTOR_EVENTLOG_MSG_DETAIL
347             value: "{{ .Values.config.sdnr.vesCollector.eventLogMsgDetail | default "SHORT" }}"
348           - name: SDNR_VES_COLLECTOR_USERNAME
349             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ves-collector-secret" "key" "login") | indent 12 }}
350           - name: SDNR_VES_COLLECTOR_PASSWORD
351             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ves-collector-secret" "key" "password") | indent 12 }}
352           - name: SDNR_WEBSOCKET_PORT
353             value: "{{ .Values.sdnrWebsocketPort | default "8182"}}"
354           - name: SDNR_KAFKA_ENABLED
355             value: "{{ .Values.config.sdnr.kafka.enabled | default "false" }}"
356           {{ if .Values.config.sdnr.kafka.enabled }}
357           - name: SDNR_KAFKA_BOOTSTRAP_SERVERS
358             value: "{{ .Values.config.sdnr.kafka.bootstrapServers | default (include "common.release" .) }}-strimzi-kafka-bootstrap.{{.Release.Namespace}}:9092"
359           - name: SDNR_KAFKA_SECURITY_PROTOCOL
360             value: "{{ .Values.config.sdnr.kafka.securityProtocol | default "PLAINTEXT" }}"
361           - name: SDNR_KAFKA_SASL_MECHANISM
362             value: "{{ .Values.config.sdnr.kafka.saslMechanism | default "PLAIN" }}"
363           - name: SDNR_KAFKA_SASL_JASS_CONFIG
364             value: "{{ .Values.config.sdnr.kafka.saslJassConfig | default "PLAIN" }}"
365           {{ end }}
366
367
368           volumeMounts:
369 {{- if .Values.global.cmpv2Enabled }}
370 {{ include "common.certManager.volumeMounts" . | indent 10 }}
371 {{- end }}
372           - mountPath: /etc/localtime
373             name: localtime
374             readOnly: true
375           - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
376             name: sdnc-logging-cfg-config
377             subPath: org.ops4j.pax.logging.cfg
378           - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
379             name: bin
380             subPath: installSdncDb.sh
381           - mountPath: {{ .Values.config.binDir }}/createLinks.sh
382             name: bin
383             subPath: createLinks.sh
384           - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
385             name: properties
386             subPath: aaiclient.properties
387           - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
388             name: properties
389             subPath: aaiclient.properties
390           - mountPath: {{ .Values.config.configDir }}/dblib.properties
391             name: properties
392             subPath: dblib.properties
393           - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
394             name: properties
395             subPath: lcm-dg.properties
396           - mountPath: {{ .Values.config.configDir }}/svclogic.properties
397             name: properties
398             subPath: svclogic.properties
399           - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
400             name: properties
401             subPath: svclogic.properties
402           - mountPath: {{ .Values.config.configDir }}/netbox.properties
403             name: properties
404             subPath: netbox.properties
405           - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
406             name: properties
407             subPath: blueprints-processor-adaptor.properties
408           - mountPath: {{ .Values.persistence.mdsalPath }}
409             name: {{ include "common.fullname" . }}-data
410           - mountPath: {{ .Values.log.path }}
411             name: logs
412           - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
413             name: properties
414             subPath: akka.conf
415           - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
416             name: properties
417             subPath: org.opendaylight.controller.cluster.datastore.cfg
418           - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.aaa.filterchain.cfg
419             name: properties
420             subPath: org.opendaylight.aaa.filterchain.cfg
421           - mountPath: {{ .Values.config.odl.binDir }}/setenv
422             name: properties
423             subPath: setenv
424           - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-registrar.properties
425             name: properties
426             subPath: mountpoint-registrar.properties
427           - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
428             name: properties
429             subPath: mountpoint-state-provider.properties
430           - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.daexim.cfg
431             name: properties
432             subPath: org.opendaylight.daexim.cfg
433           {{- if .Values.config.sdnr.oauth.enabled }}
434           - mountPath: {{ .Values.config.odl.etcDir }}/oauth-provider.config.json
435             name: properties
436             subPath: oauth-provider.config.json
437           {{ end }}
438           resources: {{ include "common.resources" . | nindent 12 }}
439         # side car containers
440         {{ include "common.log.sidecar" . | nindent 8 }}
441       {{- if .Values.nodeSelector }}
442       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
443       {{- end }}
444       {{- if .Values.affinity }}
445       affinity: {{ toYaml .Values.affinity | nindent 8 }}
446       {{- end }}
447       imagePullSecrets:
448       - name: "{{ include "common.namespace" . }}-docker-registry-key"
449       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
450       volumes:
451         - name: localtime
452           hostPath:
453             path: /etc/localtime
454         - name: logs
455           emptyDir: {}
456         {{ include "common.log.volumes" . | nindent 8 }}
457         - name: sdnc-logging-cfg-config
458           configMap:
459             name: {{ include "common.fullname" . }}-log-configmap
460         - name: bin
461           configMap:
462             name: {{ include "common.fullname" . }}-bin
463             defaultMode: 0755
464         - name: config-input
465           configMap:
466             name: {{ include "common.fullname" . }}-properties
467             defaultMode: 0644
468         - name: properties
469           emptyDir:
470             medium: Memory
471   {{ if not .Values.persistence.enabled }}
472         - name: {{ include "common.fullname" . }}-data
473           emptyDir: {}
474   {{ else }}
475 {{- if .Values.global.cmpv2Enabled }}
476 {{ include "common.certManager.volumes" . | nindent 8 }}
477 {{- end }}
478   volumeClaimTemplates:
479   - metadata:
480       name: {{ include "common.fullname" . }}-data
481       labels:
482         name: {{ include "common.fullname" . }}
483         chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
484         release: "{{ include "common.release" . }}"
485         heritage: "{{ .Release.Service }}"
486     spec:
487       accessModes:
488       - {{ .Values.persistence.accessMode }}
489       storageClassName: {{ include "common.storageClass" . }}
490       resources:
491         requests:
492           storage: {{ .Values.persistence.size }}
493   {{- end }}