blob: da5d8f30d4699f32927b595d068401886a4b10ae [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
jmac065e2ce2018-03-29 01:18:02 +00002# Copyright © 2017 Amdocs, Bell Canada
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010015*/}}
jmac065e2ce2018-03-29 01:18:02 +000016
17apiVersion: apps/v1beta1
18kind: StatefulSet
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000026 heritage: {{ .Release.Service }}
27spec:
BorislavG1ffbd992018-04-24 07:56:27 +000028 serviceName: {{ include "common.servicename" . }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000029 replicas: {{ .Values.replicaCount }}
30 podManagementPolicy: Parallel
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010035 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000036 spec:
37 initContainers:
38 - command:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010039 - sh
40 args:
41 - -c
42 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
43 env:
44 - name: AAI_CLIENT_NAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010045 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010046 - name: AAI_CLIENT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010047 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010048 - name: MODELSERVICE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010049 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010050 - name: MODELSERVICE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010051 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010052 - name: RESTCONF_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010053 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010054 - name: RESTCONF_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010055 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010056 - name: ANSIBLE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010057 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010058 - name: ANSIBLE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010059 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010060 - name: SCALEOUT_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010061 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010062 - name: SCALEOUT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010063 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010064 - name: NETBOX_APIKEY
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010065 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010066 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010067 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010068 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010069 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010070 volumeMounts:
71 - mountPath: /config-input
72 name: config-input
73 - mountPath: /config
74 name: properties
75 image: "{{ .Values.global.envsubstImage }}"
76 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77 name: {{ include "common.name" . }}-update-config
78
79 - command:
jmac065e2ce2018-03-29 01:18:02 +000080 - /root/ready.py
81 args:
82 - --container-name
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010083 - {{ include "common.mariadbService" . }}
jmac065e2ce2018-03-29 01:18:02 +000084 env:
85 - name: NAMESPACE
86 valueFrom:
87 fieldRef:
88 apiVersion: v1
89 fieldPath: metadata.namespace
90 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
91 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010092 name: {{ include "common.name" . }}-readiness
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +000093 {{ if .Values.global.aafEnabled }}
94 - name: {{ include "common.name" . }}-aaf-readiness
95 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
96 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
97 command:
98 - /root/ready.py
99 args:
100 - --container-name
101 - aaf-locate
102 env:
103 - name: NAMESPACE
104 valueFrom:
105 fieldRef:
106 apiVersion: v1
107 fieldPath: metadata.namespace
108 - name: {{ include "common.name" . }}-aaf
109 image: {{ .Values.global.repository }}/{{ .Values.aaf_init.agentImage }}
110 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 volumeMounts:
112 - mountPath: {{ .Values.certpersistence.certPath }}
113 name: {{ include "common.fullname" . }}-certs
114 command:
115 - bash
116 - -c
117 - |
118 /opt/app/aaf_config/bin/agent.sh &&
119 cd /opt/app/osaaf/local &&
120 /opt/app/aaf_config/bin/agent.sh local showpass | grep cadi_keystore_password= | cut -d= -f 2 > /opt/app/osaaf/local/.pass 2>&1
121 env:
122 - name: APP_FQI
123 value: "{{ .Values.aaf_init.fqi }}"
124 - name: aaf_locate_url
125 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
126 - name: aaf_locator_container
127 value: "oom"
128 - name: aaf_locator_container_ns
129 value: "{{ .Release.Namespace }}"
130 - name: aaf_locator_fqdn
131 value: "{{ .Values.aaf_init.fqdn }}"
132 - name: aaf_locator_app_ns
133 value: "{{ .Values.aaf_init.app_ns }}"
134 - name: DEPLOY_FQI
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100135 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aaf-creds" "key" "login") | indent 12 }}
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +0000136 - name: DEPLOY_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100137 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aaf-creds" "key" "password") | indent 12 }}
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +0000138 - name: cadi_longitude
139 value: "{{ .Values.aaf_init.cadi_longitude }}"
140 - name: cadi_latitude
141 value: "{{ .Values.aaf_init.cadi_latitude }}"
142 {{ end }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400143 - name: {{ include "common.name" . }}-chown
144 image: "busybox"
145 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 }}"]
146 volumeMounts:
147 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100148 name: {{ include "common.fullname" . }}-data
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400149 - mountPath: {{ .Values.certpersistence.certPath }}
150 name: {{ include "common.fullname" . }}-certs
jmac065e2ce2018-03-29 01:18:02 +0000151 containers:
152 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +0000153 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +0000154 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
155 command: ["/bin/bash"]
156 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
157 ports:
158 - containerPort: {{ .Values.service.internalPort }}
159 - containerPort: {{ .Values.service.internalPort2 }}
160 - containerPort: {{ .Values.service.internalPort3 }}
161 - containerPort: {{ .Values.service.clusterPort }}
162 readinessProbe:
163 tcpSocket:
164 port: {{ .Values.service.internalPort }}
165 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
166 periodSeconds: {{ .Values.readiness.periodSeconds }}
167 env:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100168 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100169 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100170 - name: ODL_ADMIN_USERNAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100171 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100172 - name: ODL_ADMIN_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100173 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100174 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100175 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100176 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100177 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100178 - name: SDNC_CONFIG_DIR
179 value: "{{ .Values.config.configDir }}"
180 - name: ENABLE_ODL_CLUSTER
181 value: "{{ .Values.config.enableClustering }}"
182 - name: MY_ODL_CLUSTER
183 value: "{{ .Values.config.myODLCluster }}"
184 - name: PEER_ODL_CLUSTER
185 value: "{{ .Values.config.peerODLCluster }}"
186 - name: IS_PRIMARY_CLUSTER
187 value: "{{ .Values.config.isPrimaryCluster }}"
188 - name: GEO_ENABLED
189 value: "{{ .Values.config.geoEnabled}}"
190 - name: SDNC_AAF_ENABLED
191 value: "{{ .Values.global.aafEnabled}}"
192 - name: SDNC_REPLICAS
193 value: "{{ .Values.replicaCount }}"
194 - name: MYSQL_HOST
195 value: {{ include "common.mariadbService" . }}
196 - name: JAVA_HOME
197 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000198 volumeMounts:
199 - mountPath: /etc/localtime
200 name: localtime
201 readOnly: true
202 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
203 name: sdnc-logging-cfg-config
204 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000205 - mountPath: {{ .Values.config.binDir }}/startODL.sh
206 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000207 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000208 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
209 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000210 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +0000211 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
212 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000213 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000214 - mountPath: {{ .Values.config.configDir }}/dblib.properties
215 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000216 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000217 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
218 name: properties
219 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000220 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
221 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000222 subPath: svclogic.properties
223 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000224 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000225 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400226 - mountPath: {{ .Values.config.configDir }}/netbox.properties
227 name: properties
228 subPath: netbox.properties
229 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
230 name: properties
231 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000232 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100233 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000234 - mountPath: /var/log/onap
235 name: logs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000236 - mountPath: {{ .Values.certpersistence.certPath }}
237 name: {{ include "common.fullname" . }}-certs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400238 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
239 name: properties
240 subPath: akka.conf
241 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
242 name: properties
243 subPath: org.opendaylight.controller.cluster.datastore.cfg
244 - mountPath: {{ .Values.config.odl.binDir }}/setenv
245 name: properties
246 subPath: setenv
jmac065e2ce2018-03-29 01:18:02 +0000247 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000248{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000249 {{- if .Values.nodeSelector }}
250 nodeSelector:
251{{ toYaml .Values.nodeSelector | indent 10 }}
252 {{- end -}}
253 {{- if .Values.affinity }}
254 affinity:
255{{ toYaml .Values.affinity | indent 10 }}
256 {{- end }}
257
258 # side car containers
259 - name: filebeat-onap
260 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
261 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
262 volumeMounts:
263 - mountPath: /usr/share/filebeat/filebeat.yml
264 name: filebeat-conf
265 subPath: filebeat.yml
266 - mountPath: /var/log/onap
267 name: logs
268 - mountPath: /usr/share/filebeat/data
269 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000270 imagePullSecrets:
271 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000272 volumes:
273 - name: localtime
274 hostPath:
275 path: /etc/localtime
276 - name: logs
277 emptyDir: {}
278 - name: data-filebeat
279 emptyDir: {}
280 - name: filebeat-conf
281 configMap:
282 name: {{ include "common.fullname" . }}-filebeat-configmap
283 - name: sdnc-logging-cfg-config
284 configMap:
285 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000286 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000287 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000288 name: {{ include "common.fullname" . }}-bin
289 defaultMode: 0755
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100290 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000291 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000292 name: {{ include "common.fullname" . }}-properties
293 defaultMode: 0644
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100294 - name: properties
295 emptyDir:
296 medium: Memory
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000297 - name: {{ include "common.fullname" . }}-certs
298 {{ if .Values.certpersistence.enabled }}
299 persistentVolumeClaim:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100300 claimName: {{ include "common.fullname" . }}-certs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000301 {{ else }}
302 emptyDir: {}
303 {{ end }}
jmac8d6dc962018-04-26 14:26:55 +0000304 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100305 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000306 emptyDir: {}
307 {{ else }}
308 volumeClaimTemplates:
309 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100310 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000311 labels:
312 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100313 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100314 release: "{{ include "common.release" . }}"
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100315 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000316 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100317 accessModes:
318 - {{ .Values.persistence.accessMode }}
319 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000320 resources:
321 requests:
322 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100323 {{- end }}