blob: d765197f13efee37858140b5f0013f2b3576f004 [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
Alexander Dehn9b797d62020-04-21 09:53:50 +00002# Copyright © 2020 Samsung Electronics, highstreet technologies GmbH
jmac065e2ce2018-03-29 01:18:02 +00003# Copyright © 2017 Amdocs, Bell Canada
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010016*/}}
jmac065e2ce2018-03-29 01:18:02 +000017
Grzegorz-Lis1318a772020-07-23 15:08:43 +020018apiVersion: apps/v1
jmac065e2ce2018-03-29 01:18:02 +000019kind: StatefulSet
Alexander Dehn9b797d62020-04-21 09:53:50 +000020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
jmac065e2ce2018-03-29 01:18:02 +000021spec:
Grzegorz-Lis1318a772020-07-23 15:08:43 +020022 selector:
23 matchLabels:
24 app: {{ include "common.name" . }}
BorislavG1ffbd992018-04-24 07:56:27 +000025 serviceName: {{ include "common.servicename" . }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000026 replicas: {{ .Values.replicaCount }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000027 selector: {{- include "common.selectors" . | nindent 4 }}
jmac065e2ce2018-03-29 01:18:02 +000028 podManagementPolicy: Parallel
29 template:
Alexander Dehn9b797d62020-04-21 09:53:50 +000030 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
jmac065e2ce2018-03-29 01:18:02 +000031 spec:
32 initContainers:
33 - command:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010034 - sh
35 args:
36 - -c
37 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
38 env:
39 - name: AAI_CLIENT_NAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010040 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010041 - name: AAI_CLIENT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010042 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010043 - name: MODELSERVICE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010044 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010045 - name: MODELSERVICE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010046 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010047 - name: RESTCONF_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010049 - name: RESTCONF_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010051 - name: ANSIBLE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010053 - name: ANSIBLE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010054 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010055 - name: SCALEOUT_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010056 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010057 - name: SCALEOUT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010058 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010059 - name: NETBOX_APIKEY
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010060 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010061 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010062 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010063 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010064 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010065 volumeMounts:
66 - mountPath: /config-input
67 name: config-input
68 - mountPath: /config
69 name: properties
70 image: "{{ .Values.global.envsubstImage }}"
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-update-config
Alexander Dehn9b797d62020-04-21 09:53:50 +000073 {{ if .Values.dgbuilder.enabled -}}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010074 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020075 - /app/ready.py
jmac065e2ce2018-03-29 01:18:02 +000076 args:
Alexander Dehn9b797d62020-04-21 09:53:50 +000077 {{ if or .Values.dgbuilder.enabled .Values.config.sdnr.enabled -}}
jmac065e2ce2018-03-29 01:18:02 +000078 - --container-name
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010079 - {{ include "common.mariadbService" . }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000080 {{ end -}}
81 {{ if .Values.config.sdnr.enabled -}}
82 - --container-name
83 - {{ include "common.name" . }}-sdnrdb-init-job
84 {{ end -}}
jmac065e2ce2018-03-29 01:18:02 +000085 env:
86 - name: NAMESPACE
87 valueFrom:
88 fieldRef:
89 apiVersion: v1
90 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020091 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
jmac065e2ce2018-03-29 01:18:02 +000092 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010093 name: {{ include "common.name" . }}-readiness
Alexander Dehn9b797d62020-04-21 09:53:50 +000094 {{ end -}}
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +020095{{ include "common.certInitializer.initContainer" . | indent 6 }}
96
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -040097 - name: {{ include "common.name" . }}-chown
Alexander Dehn1373c9c2020-09-02 09:01:15 +000098 image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }}
Lucjan Bryndza5c63e932020-06-25 08:43:23 +000099 command:
100 - sh
101 args:
102 - -c
103 - chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
104{{- if .Values.global.aafEnabled }}
105 - chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certInitializer.credsPath }}
106{{- end }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400107 volumeMounts:
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200108{{ include "common.certInitializer.volumeMount" . | indent 10 }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400109 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100110 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000111 containers:
112 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +0000113 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +0000114 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Alexander Dehn9b797d62020-04-21 09:53:50 +0000115 {{- if not .Values.config.sdnr.enabled }}
jmac065e2ce2018-03-29 01:18:02 +0000116 command: ["/bin/bash"]
Dan Timoney830b85f2020-05-27 16:00:05 -0400117 args: ["-c", "/opt/onap/sdnc/bin/startODL.sh"]
Alexander Dehn9b797d62020-04-21 09:53:50 +0000118 {{ else }}
119 command: ["/bin/bash"]
120 args: ["-c", "{{ .Values.config.binDir }}/startODL.oom.sh"]
121 {{ end }}
jmac065e2ce2018-03-29 01:18:02 +0000122 ports:
123 - containerPort: {{ .Values.service.internalPort }}
124 - containerPort: {{ .Values.service.internalPort2 }}
125 - containerPort: {{ .Values.service.internalPort3 }}
126 - containerPort: {{ .Values.service.clusterPort }}
127 readinessProbe:
128 tcpSocket:
129 port: {{ .Values.service.internalPort }}
130 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
131 periodSeconds: {{ .Values.readiness.periodSeconds }}
132 env:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100133 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100134 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100135 - name: ODL_ADMIN_USERNAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100136 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100137 - name: ODL_ADMIN_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100138 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100139 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100140 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100141 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100142 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100143 - name: SDNC_CONFIG_DIR
144 value: "{{ .Values.config.configDir }}"
145 - name: ENABLE_ODL_CLUSTER
146 value: "{{ .Values.config.enableClustering }}"
147 - name: MY_ODL_CLUSTER
148 value: "{{ .Values.config.myODLCluster }}"
149 - name: PEER_ODL_CLUSTER
150 value: "{{ .Values.config.peerODLCluster }}"
151 - name: IS_PRIMARY_CLUSTER
152 value: "{{ .Values.config.isPrimaryCluster }}"
153 - name: GEO_ENABLED
154 value: "{{ .Values.config.geoEnabled}}"
155 - name: SDNC_AAF_ENABLED
156 value: "{{ .Values.global.aafEnabled}}"
157 - name: SDNC_REPLICAS
158 value: "{{ .Values.replicaCount }}"
159 - name: MYSQL_HOST
160 value: {{ include "common.mariadbService" . }}
161 - name: JAVA_HOME
162 value: "{{ .Values.config.javaHome}}"
Sylvain Desbureauxbcf72512020-07-22 10:45:18 +0200163 - name: KARAF_CONSOLE_LOG_LEVEL
164 value: "{{ include "common.log.level" . }}"
Alexander Dehn9b797d62020-04-21 09:53:50 +0000165 - name: SDNRWT
166 value: "{{ .Values.config.sdnr.enabled | default "false"}}"
167 {{- if eq .Values.config.sdnr.mode "web" }}
168 - name: SDNRDM
169 value: "true"
170 {{- end }}
171 - name: SDNRONLY
172 value: "{{ .Values.config.sdnr.sdnronly | default "false" }}"
173 - name: SDNRDBURL
174 {{- $prefix := ternary "https" "http" .Values.global.aafEnabled}}
175 value: "{{$prefix}}://{{ .Values.elasticsearch.service.name | default "sdnrdb"}}.{{.Release.Namespace}}:{{.Values.elasticsearch.service.port | default "9200"}}"
176 {{- if .Values.config.sdnr.sdnrdbTrustAllCerts }}
177 - name: SDNRDBTRUSTALLCERTS
178 value: "true"
179 {{ end }}
180
jmac065e2ce2018-03-29 01:18:02 +0000181 volumeMounts:
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200182{{ include "common.certInitializer.volumeMount" . | indent 10 }}
jmac065e2ce2018-03-29 01:18:02 +0000183 - mountPath: /etc/localtime
184 name: localtime
185 readOnly: true
186 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
187 name: sdnc-logging-cfg-config
188 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000189 - mountPath: {{ .Values.config.binDir }}/startODL.sh
190 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000191 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000192 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
193 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000194 subPath: installSdncDb.sh
Konrad Bańka5ea1db32020-04-06 14:32:46 +0200195 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
196 name: properties
197 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000198 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
199 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000200 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000201 - mountPath: {{ .Values.config.configDir }}/dblib.properties
202 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000203 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000204 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
205 name: properties
206 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000207 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
208 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000209 subPath: svclogic.properties
210 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000211 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000212 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400213 - mountPath: {{ .Values.config.configDir }}/netbox.properties
214 name: properties
215 subPath: netbox.properties
216 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
217 name: properties
218 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000219 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100220 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000221 - mountPath: /var/log/onap
222 name: logs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400223 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
224 name: properties
225 subPath: akka.conf
226 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
227 name: properties
228 subPath: org.opendaylight.controller.cluster.datastore.cfg
229 - mountPath: {{ .Values.config.odl.binDir }}/setenv
230 name: properties
231 subPath: setenv
Alexander Dehn9b797d62020-04-21 09:53:50 +0000232 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-registrar.properties
233 name: properties
234 subPath: mountpoint-registrar.properties
235 - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
236 name: properties
237 subPath: mountpoint-state-provider.properties
jmac065e2ce2018-03-29 01:18:02 +0000238 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000239{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000240 {{- if .Values.nodeSelector }}
241 nodeSelector:
242{{ toYaml .Values.nodeSelector | indent 10 }}
243 {{- end -}}
244 {{- if .Values.affinity }}
245 affinity:
246{{ toYaml .Values.affinity | indent 10 }}
247 {{- end }}
248
249 # side car containers
250 - name: filebeat-onap
251 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
252 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
253 volumeMounts:
254 - mountPath: /usr/share/filebeat/filebeat.yml
255 name: filebeat-conf
256 subPath: filebeat.yml
257 - mountPath: /var/log/onap
258 name: logs
259 - mountPath: /usr/share/filebeat/data
260 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000261 imagePullSecrets:
262 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000263 volumes:
264 - name: localtime
265 hostPath:
266 path: /etc/localtime
267 - name: logs
268 emptyDir: {}
269 - name: data-filebeat
270 emptyDir: {}
271 - name: filebeat-conf
272 configMap:
273 name: {{ include "common.fullname" . }}-filebeat-configmap
274 - name: sdnc-logging-cfg-config
275 configMap:
276 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000277 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000278 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000279 name: {{ include "common.fullname" . }}-bin
280 defaultMode: 0755
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100281 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000282 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000283 name: {{ include "common.fullname" . }}-properties
284 defaultMode: 0644
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100285 - name: properties
286 emptyDir:
287 medium: Memory
jmac8d6dc962018-04-26 14:26:55 +0000288 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100289 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000290 emptyDir: {}
291 {{ else }}
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200292{{ include "common.certInitializer.volumes" . | nindent 8 }}
jmac8d6dc962018-04-26 14:26:55 +0000293 volumeClaimTemplates:
294 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100295 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000296 labels:
297 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100298 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100299 release: "{{ include "common.release" . }}"
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100300 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000301 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100302 accessModes:
303 - {{ .Values.persistence.accessMode }}
304 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000305 resources:
306 requests:
307 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100308 {{- end }}