blob: 6054546d5810ee5bd157d51adaf2ab29cde6a153 [file] [log] [blame]
jmac065e2ce2018-03-29 01:18:02 +00001# Copyright © 2017 Amdocs, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: apps/v1beta1
16kind: StatefulSet
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000024 heritage: {{ .Release.Service }}
25spec:
BorislavG1ffbd992018-04-24 07:56:27 +000026 serviceName: {{ include "common.servicename" . }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000027 replicas: {{ .Values.replicaCount }}
28 podManagementPolicy: Parallel
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000034 spec:
35 initContainers:
36 - command:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010037 - sh
38 args:
39 - -c
40 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
41 env:
42 - name: AAI_CLIENT_NAME
43 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
44 - name: AAI_CLIENT_PASSWORD
45 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
46 - name: MODELSERVICE_USER
47 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
48 - name: MODELSERVICE_PASSWORD
49 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
50 - name: RESTCONF_USER
51 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
52 - name: RESTCONF_PASSWORD
53 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
54 - name: ANSIBLE_USER
55 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
56 - name: ANSIBLE_PASSWORD
57 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
58 - name: SCALEOUT_USER
59 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
60 - name: SCALEOUT_PASSWORD
61 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
62 - name: NETBOX_APIKEY
63 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
64 - name: SDNC_DB_USER
65 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
66 - name: SDNC_DB_PASSWORD
67 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
68 volumeMounts:
69 - mountPath: /config-input
70 name: config-input
71 - mountPath: /config
72 name: properties
73 image: "{{ .Values.global.envsubstImage }}"
74 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
75 name: {{ include "common.name" . }}-update-config
76
77 - command:
jmac065e2ce2018-03-29 01:18:02 +000078 - /root/ready.py
79 args:
80 - --container-name
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010081 - {{ include "common.mariadbService" . }}
jmac065e2ce2018-03-29 01:18:02 +000082 env:
83 - name: NAMESPACE
84 valueFrom:
85 fieldRef:
86 apiVersion: v1
87 fieldPath: metadata.namespace
88 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
89 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010090 name: {{ include "common.name" . }}-readiness
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +000091 {{ if .Values.global.aafEnabled }}
92 - name: {{ include "common.name" . }}-aaf-readiness
93 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
94 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
95 command:
96 - /root/ready.py
97 args:
98 - --container-name
99 - aaf-locate
100 env:
101 - name: NAMESPACE
102 valueFrom:
103 fieldRef:
104 apiVersion: v1
105 fieldPath: metadata.namespace
106 - name: {{ include "common.name" . }}-aaf
107 image: {{ .Values.global.repository }}/{{ .Values.aaf_init.agentImage }}
108 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
109 volumeMounts:
110 - mountPath: {{ .Values.certpersistence.certPath }}
111 name: {{ include "common.fullname" . }}-certs
112 command:
113 - bash
114 - -c
115 - |
116 /opt/app/aaf_config/bin/agent.sh &&
117 cd /opt/app/osaaf/local &&
118 /opt/app/aaf_config/bin/agent.sh local showpass | grep cadi_keystore_password= | cut -d= -f 2 > /opt/app/osaaf/local/.pass 2>&1
119 env:
120 - name: APP_FQI
121 value: "{{ .Values.aaf_init.fqi }}"
122 - name: aaf_locate_url
123 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
124 - name: aaf_locator_container
125 value: "oom"
126 - name: aaf_locator_container_ns
127 value: "{{ .Release.Namespace }}"
128 - name: aaf_locator_fqdn
129 value: "{{ .Values.aaf_init.fqdn }}"
130 - name: aaf_locator_app_ns
131 value: "{{ .Values.aaf_init.app_ns }}"
132 - name: DEPLOY_FQI
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100133 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "aaf-creds" "key" "login") | indent 12 }}
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +0000134 - name: DEPLOY_PASSWORD
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100135 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "aaf-creds" "key" "password") | indent 12 }}
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +0000136 - name: cadi_longitude
137 value: "{{ .Values.aaf_init.cadi_longitude }}"
138 - name: cadi_latitude
139 value: "{{ .Values.aaf_init.cadi_latitude }}"
140 {{ end }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400141 - name: {{ include "common.name" . }}-chown
142 image: "busybox"
143 command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }} ; chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certpersistence.certPath }}"]
144 volumeMounts:
145 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100146 name: {{ include "common.fullname" . }}-data
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400147 - mountPath: {{ .Values.certpersistence.certPath }}
148 name: {{ include "common.fullname" . }}-certs
jmac065e2ce2018-03-29 01:18:02 +0000149 containers:
150 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +0000151 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +0000152 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
153 command: ["/bin/bash"]
154 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
155 ports:
156 - containerPort: {{ .Values.service.internalPort }}
157 - containerPort: {{ .Values.service.internalPort2 }}
158 - containerPort: {{ .Values.service.internalPort3 }}
159 - containerPort: {{ .Values.service.clusterPort }}
160 readinessProbe:
161 tcpSocket:
162 port: {{ .Values.service.internalPort }}
163 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
164 periodSeconds: {{ .Values.readiness.periodSeconds }}
165 env:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100166 - name: MYSQL_ROOT_PASSWORD
167 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
168 - name: ODL_ADMIN_USERNAME
169 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
170 - name: ODL_ADMIN_PASSWORD
171 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
172 - name: SDNC_DB_USER
173 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
174 - name: SDNC_DB_PASSWORD
175 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
176 - name: SDNC_CONFIG_DIR
177 value: "{{ .Values.config.configDir }}"
178 - name: ENABLE_ODL_CLUSTER
179 value: "{{ .Values.config.enableClustering }}"
180 - name: MY_ODL_CLUSTER
181 value: "{{ .Values.config.myODLCluster }}"
182 - name: PEER_ODL_CLUSTER
183 value: "{{ .Values.config.peerODLCluster }}"
184 - name: IS_PRIMARY_CLUSTER
185 value: "{{ .Values.config.isPrimaryCluster }}"
186 - name: GEO_ENABLED
187 value: "{{ .Values.config.geoEnabled}}"
188 - name: SDNC_AAF_ENABLED
189 value: "{{ .Values.global.aafEnabled}}"
190 - name: SDNC_REPLICAS
191 value: "{{ .Values.replicaCount }}"
192 - name: MYSQL_HOST
193 value: {{ include "common.mariadbService" . }}
194 - name: JAVA_HOME
195 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000196 volumeMounts:
197 - mountPath: /etc/localtime
198 name: localtime
199 readOnly: true
200 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
201 name: sdnc-logging-cfg-config
202 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000203 - mountPath: {{ .Values.config.binDir }}/startODL.sh
204 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000205 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000206 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
207 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000208 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +0000209 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
210 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000211 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000212 - mountPath: {{ .Values.config.configDir }}/dblib.properties
213 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000214 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000215 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
216 name: properties
217 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000218 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
219 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000220 subPath: svclogic.properties
221 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000222 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000223 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400224 - mountPath: {{ .Values.config.configDir }}/netbox.properties
225 name: properties
226 subPath: netbox.properties
227 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
228 name: properties
229 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000230 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100231 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000232 - mountPath: /var/log/onap
233 name: logs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000234 - mountPath: {{ .Values.certpersistence.certPath }}
235 name: {{ include "common.fullname" . }}-certs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400236 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
237 name: properties
238 subPath: akka.conf
239 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
240 name: properties
241 subPath: org.opendaylight.controller.cluster.datastore.cfg
242 - mountPath: {{ .Values.config.odl.binDir }}/setenv
243 name: properties
244 subPath: setenv
jmac065e2ce2018-03-29 01:18:02 +0000245 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000246{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000247 {{- if .Values.nodeSelector }}
248 nodeSelector:
249{{ toYaml .Values.nodeSelector | indent 10 }}
250 {{- end -}}
251 {{- if .Values.affinity }}
252 affinity:
253{{ toYaml .Values.affinity | indent 10 }}
254 {{- end }}
255
256 # side car containers
257 - name: filebeat-onap
258 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
259 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
260 volumeMounts:
261 - mountPath: /usr/share/filebeat/filebeat.yml
262 name: filebeat-conf
263 subPath: filebeat.yml
264 - mountPath: /var/log/onap
265 name: logs
266 - mountPath: /usr/share/filebeat/data
267 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000268 imagePullSecrets:
269 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000270 volumes:
271 - name: localtime
272 hostPath:
273 path: /etc/localtime
274 - name: logs
275 emptyDir: {}
276 - name: data-filebeat
277 emptyDir: {}
278 - name: filebeat-conf
279 configMap:
280 name: {{ include "common.fullname" . }}-filebeat-configmap
281 - name: sdnc-logging-cfg-config
282 configMap:
283 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000284 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000285 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000286 name: {{ include "common.fullname" . }}-bin
287 defaultMode: 0755
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100288 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000289 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000290 name: {{ include "common.fullname" . }}-properties
291 defaultMode: 0644
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100292 - name: properties
293 emptyDir:
294 medium: Memory
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000295 - name: {{ include "common.fullname" . }}-certs
296 {{ if .Values.certpersistence.enabled }}
297 persistentVolumeClaim:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100298 claimName: {{ include "common.fullname" . }}-certs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000299 {{ else }}
300 emptyDir: {}
301 {{ end }}
jmac8d6dc962018-04-26 14:26:55 +0000302 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100303 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000304 emptyDir: {}
305 {{ else }}
306 volumeClaimTemplates:
307 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100308 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000309 labels:
310 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100311 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100312 release: "{{ include "common.release" . }}"
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100313 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000314 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100315 accessModes:
316 - {{ .Values.persistence.accessMode }}
317 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000318 resources:
319 requests:
320 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100321 {{- end }}