blob: 437cb31a8e3e50dcceab9b785454c2501f9b5e9a [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
Konrad Bańka5ea1db32020-04-06 14:32:46 +02002# Copyright © 2020 Samsung Electronics
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
20metadata:
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000027 heritage: {{ .Release.Service }}
28spec:
Grzegorz-Lis1318a772020-07-23 15:08:43 +020029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
BorislavG1ffbd992018-04-24 07:56:27 +000032 serviceName: {{ include "common.servicename" . }}-cluster
jmac065e2ce2018-03-29 01:18:02 +000033 replicas: {{ .Values.replicaCount }}
34 podManagementPolicy: Parallel
35 template:
36 metadata:
37 labels:
38 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010039 release: {{ include "common.release" . }}
jmac065e2ce2018-03-29 01:18:02 +000040 spec:
41 initContainers:
42 - command:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010043 - sh
44 args:
45 - -c
46 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
47 env:
48 - name: AAI_CLIENT_NAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010049 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010050 - name: AAI_CLIENT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010051 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010052 - name: MODELSERVICE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010053 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010054 - name: MODELSERVICE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010055 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "modeling-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010056 - name: RESTCONF_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010057 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010058 - name: RESTCONF_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010059 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restconf-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010060 - name: ANSIBLE_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010061 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010062 - name: ANSIBLE_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010063 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ansible-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010064 - name: SCALEOUT_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010065 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010066 - name: SCALEOUT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010067 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "scaleout-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010068 - name: NETBOX_APIKEY
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010069 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "netbox-apikey" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010070 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010071 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010072 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010073 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010074 volumeMounts:
75 - mountPath: /config-input
76 name: config-input
77 - mountPath: /config
78 name: properties
79 image: "{{ .Values.global.envsubstImage }}"
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 name: {{ include "common.name" . }}-update-config
82
83 - command:
jmac065e2ce2018-03-29 01:18:02 +000084 - /root/ready.py
85 args:
86 - --container-name
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +010087 - {{ include "common.mariadbService" . }}
jmac065e2ce2018-03-29 01:18:02 +000088 env:
89 - name: NAMESPACE
90 valueFrom:
91 fieldRef:
92 apiVersion: v1
93 fieldPath: metadata.namespace
94 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
95 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010096 name: {{ include "common.name" . }}-readiness
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +020097
98{{ include "common.certInitializer.initContainer" . | indent 6 }}
99
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400100 - name: {{ include "common.name" . }}-chown
101 image: "busybox"
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200102 command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }} ; chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.certInitializer.credsPath }}"]
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400103 volumeMounts:
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200104{{ include "common.certInitializer.volumeMount" . | indent 10 }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400105 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100106 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000107 containers:
108 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +0000109 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +0000110 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 command: ["/bin/bash"]
Dan Timoney830b85f2020-05-27 16:00:05 -0400112 args: ["-c", "/opt/onap/sdnc/bin/startODL.sh"]
jmac065e2ce2018-03-29 01:18:02 +0000113 ports:
114 - containerPort: {{ .Values.service.internalPort }}
115 - containerPort: {{ .Values.service.internalPort2 }}
116 - containerPort: {{ .Values.service.internalPort3 }}
117 - containerPort: {{ .Values.service.clusterPort }}
118 readinessProbe:
119 tcpSocket:
120 port: {{ .Values.service.internalPort }}
121 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
122 periodSeconds: {{ .Values.readiness.periodSeconds }}
123 env:
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100124 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100125 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100126 - name: ODL_ADMIN_USERNAME
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100127 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100128 - name: ODL_ADMIN_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100129 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100130 - name: SDNC_DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100131 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100132 - name: SDNC_DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +0100133 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100134 - name: SDNC_CONFIG_DIR
135 value: "{{ .Values.config.configDir }}"
136 - name: ENABLE_ODL_CLUSTER
137 value: "{{ .Values.config.enableClustering }}"
138 - name: MY_ODL_CLUSTER
139 value: "{{ .Values.config.myODLCluster }}"
140 - name: PEER_ODL_CLUSTER
141 value: "{{ .Values.config.peerODLCluster }}"
142 - name: IS_PRIMARY_CLUSTER
143 value: "{{ .Values.config.isPrimaryCluster }}"
144 - name: GEO_ENABLED
145 value: "{{ .Values.config.geoEnabled}}"
146 - name: SDNC_AAF_ENABLED
147 value: "{{ .Values.global.aafEnabled}}"
148 - name: SDNC_REPLICAS
149 value: "{{ .Values.replicaCount }}"
150 - name: MYSQL_HOST
151 value: {{ include "common.mariadbService" . }}
152 - name: JAVA_HOME
153 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000154 volumeMounts:
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200155{{ include "common.certInitializer.volumeMount" . | indent 10 }}
jmac065e2ce2018-03-29 01:18:02 +0000156 - mountPath: /etc/localtime
157 name: localtime
158 readOnly: true
159 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
160 name: sdnc-logging-cfg-config
161 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000162 - mountPath: {{ .Values.config.binDir }}/startODL.sh
163 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000164 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000165 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
166 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000167 subPath: installSdncDb.sh
Konrad Bańka5ea1db32020-04-06 14:32:46 +0200168 - mountPath: {{ .Values.config.ccsdkConfigDir }}/aaiclient.properties
169 name: properties
170 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000171 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
172 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000173 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000174 - mountPath: {{ .Values.config.configDir }}/dblib.properties
175 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000176 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000177 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
178 name: properties
179 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000180 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
181 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000182 subPath: svclogic.properties
183 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000184 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000185 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400186 - mountPath: {{ .Values.config.configDir }}/netbox.properties
187 name: properties
188 subPath: netbox.properties
189 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
190 name: properties
191 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000192 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100193 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000194 - mountPath: /var/log/onap
195 name: logs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400196 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
197 name: properties
198 subPath: akka.conf
199 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
200 name: properties
201 subPath: org.opendaylight.controller.cluster.datastore.cfg
202 - mountPath: {{ .Values.config.odl.binDir }}/setenv
203 name: properties
204 subPath: setenv
jmac065e2ce2018-03-29 01:18:02 +0000205 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000206{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000207 {{- if .Values.nodeSelector }}
208 nodeSelector:
209{{ toYaml .Values.nodeSelector | indent 10 }}
210 {{- end -}}
211 {{- if .Values.affinity }}
212 affinity:
213{{ toYaml .Values.affinity | indent 10 }}
214 {{- end }}
215
216 # side car containers
217 - name: filebeat-onap
218 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
219 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
220 volumeMounts:
221 - mountPath: /usr/share/filebeat/filebeat.yml
222 name: filebeat-conf
223 subPath: filebeat.yml
224 - mountPath: /var/log/onap
225 name: logs
226 - mountPath: /usr/share/filebeat/data
227 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000228 imagePullSecrets:
229 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000230 volumes:
231 - name: localtime
232 hostPath:
233 path: /etc/localtime
234 - name: logs
235 emptyDir: {}
236 - name: data-filebeat
237 emptyDir: {}
238 - name: filebeat-conf
239 configMap:
240 name: {{ include "common.fullname" . }}-filebeat-configmap
241 - name: sdnc-logging-cfg-config
242 configMap:
243 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000244 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000245 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000246 name: {{ include "common.fullname" . }}-bin
247 defaultMode: 0755
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100248 - name: config-input
jmac065e2ce2018-03-29 01:18:02 +0000249 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000250 name: {{ include "common.fullname" . }}-properties
251 defaultMode: 0644
Krzysztof Opasiakcc97c732020-02-25 23:31:20 +0100252 - name: properties
253 emptyDir:
254 medium: Memory
jmac8d6dc962018-04-26 14:26:55 +0000255 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100256 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000257 emptyDir: {}
258 {{ else }}
Krzysztof Opasiak8ab45472020-05-12 12:53:50 +0200259{{ include "common.certInitializer.volumes" . | nindent 8 }}
jmac8d6dc962018-04-26 14:26:55 +0000260 volumeClaimTemplates:
261 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100262 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000263 labels:
264 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100265 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100266 release: "{{ include "common.release" . }}"
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100267 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000268 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100269 accessModes:
270 - {{ .Values.persistence.accessMode }}
271 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000272 resources:
273 requests:
274 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100275 {{- end }}