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 }}
72 - mountPath: /config-input
76 image: {{ include "repositoryGenerator.image.envsubst" . }}
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 name: {{ include "common.name" . }}-update-config
79 {{ if .Values.dgbuilder.enabled -}}
83 {{ if or .Values.dgbuilder.enabled .Values.config.sdnr.enabled -}}
85 - {{ include "common.mariadbService" . }}
87 {{ if .Values.config.sdnr.enabled -}}
89 - {{ include "common.name" . }}-sdnrdb-init-job
96 fieldPath: metadata.namespace
97 image: {{ include "repositoryGenerator.image.readiness" . }}
98 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
99 name: {{ include "common.name" . }}-readiness
101 {{ include "common.certInitializer.initContainer" . | indent 6 }}
102 {{ include "common.certServiceClient.initContainer" . | indent 6 }}
103 - name: {{ include "common.name" . }}-chown
104 image: {{ include "repositoryGenerator.image.busybox" . }}
110 mkdir {{ .Values.persistence.mdsalPath }}/daexim
111 mkdir {{ .Values.persistence.mdsalPath }}/journal
112 mkdir {{ .Values.persistence.mdsalPath }}/snapshots
113 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
114 {{- if .Values.global.aafEnabled }}
115 chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certInitializer.credsPath }}
118 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
119 - mountPath: {{ .Values.persistence.mdsalPath }}
120 name: {{ include "common.fullname" . }}-data
122 - name: {{ include "common.name" . }}
123 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
124 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
125 command: ["/bin/bash"]
126 args: ["-c", "/opt/onap/sdnc/bin/createLinks.sh ; /opt/onap/sdnc/bin/startODL.sh"]
128 - containerPort: {{ .Values.service.internalPort }}
129 - containerPort: {{ .Values.service.internalPort2 }}
130 - containerPort: {{ .Values.service.internalPort3 }}
131 - containerPort: {{ .Values.service.clusterPort }}
134 port: {{ .Values.service.internalPort }}
135 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
136 periodSeconds: {{ .Values.readiness.periodSeconds }}
138 - name: MYSQL_ROOT_PASSWORD
139 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
140 - name: ODL_ADMIN_USERNAME
141 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
142 - name: ODL_ADMIN_PASSWORD
143 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
145 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
146 - name: SDNC_DB_PASSWORD
147 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
148 - name: SDNC_CONFIG_DIR
149 value: "{{ .Values.config.configDir }}"
150 - name: ENABLE_ODL_CLUSTER
151 value: "{{ .Values.config.enableClustering }}"
152 - name: MY_ODL_CLUSTER
153 value: "{{ .Values.config.myODLCluster }}"
154 - name: PEER_ODL_CLUSTER
155 value: "{{ .Values.config.peerODLCluster }}"
156 - name: IS_PRIMARY_CLUSTER
157 value: "{{ .Values.config.isPrimaryCluster }}"
159 value: "{{ .Values.config.geoEnabled}}"
160 - name: SDNC_AAF_ENABLED
161 value: "{{ .Values.global.aafEnabled}}"
162 - name: SDNC_REPLICAS
163 value: "{{ .Values.replicaCount }}"
165 value: {{ include "common.mariadbService" . }}
167 value: {{ .Values.persistence.mdsalPath }}
169 value: {{ .Values.persistence.daeximPath }}
171 value: {{ .Values.persistence.journalPath }}
172 - name: SNAPSHOTS_PATH
173 value: {{ .Values.persistence.snapshotsPath }}
175 value: "{{ .Values.config.javaHome}}"
177 value: "-Xms{{.Values.config.odl.javaOptions.minMemory}} -Xmx{{.Values.config.odl.javaOptions.maxMemory}}"
178 - name: KARAF_CONSOLE_LOG_LEVEL
179 value: "{{ include "common.log.level" . }}"
181 value: "{{ .Values.config.sdnr.enabled | default "false"}}"
182 {{- if eq .Values.config.sdnr.mode "web" }}
187 value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
189 {{- $prefix := ternary "https" "http" .Values.global.aafEnabled}}
190 value: "{{$prefix}}://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
191 {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
192 - name: SDNRDBTRUSTALLCERTS
197 {{ include "common.certInitializer.volumeMount" . | indent 10 }}
198 {{ include "common.certServiceClient.volumeMounts" . | indent 10 }}
199 - mountPath: /etc/localtime
202 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
203 name: sdnc-logging-cfg-config
204 subPath: org.ops4j.pax.logging.cfg
205 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
207 subPath: installSdncDb.sh
208 - mountPath: {{ .Values.config.binDir }}/createLinks.sh
210 subPath: createLinks.sh
211 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
213 subPath: aaiclient.properties
214 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
216 subPath: aaiclient.properties
217 - mountPath: {{ .Values.config.configDir }}/dblib.properties
219 subPath: dblib.properties
220 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
222 subPath: lcm-dg.properties
223 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
225 subPath: svclogic.properties
226 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
228 subPath: svclogic.properties
229 - mountPath: {{ .Values.config.configDir }}/netbox.properties
231 subPath: netbox.properties
232 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
234 subPath: blueprints-processor-adaptor.properties
235 - mountPath: {{ .Values.persistence.mdsalPath }}
236 name: {{ include "common.fullname" . }}-data
237 - mountPath: /var/log/onap
239 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
242 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
244 subPath: org.opendaylight.controller.cluster.datastore.cfg
245 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.aaa.filterchain.cfg
247 subPath: org.opendaylight.aaa.filterchain.cfg
248 - mountPath: {{ .Values.config.odl.binDir }}/setenv
251 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-registrar.properties
253 subPath: mountpoint-registrar.properties
254 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
256 subPath: mountpoint-state-provider.properties
258 {{ include "common.resources" . | indent 12 }}
259 {{- if .Values.nodeSelector }}
261 {{ toYaml .Values.nodeSelector | indent 10 }}
263 {{- if .Values.affinity }}
265 {{ toYaml .Values.affinity | indent 10 }}
268 # side car containers
269 - name: filebeat-onap
270 image: {{ include "repositoryGenerator.image.logging" . }}
271 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
273 - mountPath: /usr/share/filebeat/filebeat.yml
275 subPath: filebeat.yml
276 - mountPath: /var/log/onap
278 - mountPath: /usr/share/filebeat/data
281 - name: "{{ include "common.namespace" . }}-docker-registry-key"
288 - name: data-filebeat
290 - name: filebeat-conf
292 name: {{ include "common.fullname" . }}-filebeat-configmap
293 - name: sdnc-logging-cfg-config
295 name: {{ include "common.fullname" . }}-log-configmap
298 name: {{ include "common.fullname" . }}-bin
302 name: {{ include "common.fullname" . }}-properties
307 {{ if not .Values.persistence.enabled }}
308 - name: {{ include "common.fullname" . }}-data
311 {{ include "common.certInitializer.volumes" . | nindent 8 }}
312 {{ include "common.certServiceClient.volumes" . | nindent 8 }}
313 volumeClaimTemplates:
315 name: {{ include "common.fullname" . }}-data
317 name: {{ include "common.fullname" . }}
318 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
319 release: "{{ include "common.release" . }}"
320 heritage: "{{ .Release.Service }}"
323 - {{ .Values.persistence.accessMode }}
324 storageClassName: {{ include "common.storageClass" . }}
327 storage: {{ .Values.persistence.size }}