blob: 536eaaf552d89c56c528c89e0b4ddc58b24da06b [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 "+" "_" }}
23 release: {{ .Release.Name }}
24 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" . }}
33 release: {{ .Release.Name }}
34 spec:
35 initContainers:
36 - command:
37 - /root/ready.py
38 args:
39 - --container-name
Mahendra Raghuwanshib76cb282019-04-09 10:13:07 +000040 - {{ .Values.config.mariadbGalera.chartName }}
jmac065e2ce2018-03-29 01:18:02 +000041 env:
42 - name: NAMESPACE
43 valueFrom:
44 fieldRef:
45 apiVersion: v1
46 fieldPath: metadata.namespace
47 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010049 name: {{ include "common.name" . }}-readiness
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +000050 {{ if .Values.global.aafEnabled }}
51 - name: {{ include "common.name" . }}-aaf-readiness
52 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 command:
55 - /root/ready.py
56 args:
57 - --container-name
58 - aaf-locate
59 env:
60 - name: NAMESPACE
61 valueFrom:
62 fieldRef:
63 apiVersion: v1
64 fieldPath: metadata.namespace
65 - name: {{ include "common.name" . }}-aaf
66 image: {{ .Values.global.repository }}/{{ .Values.aaf_init.agentImage }}
67 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 volumeMounts:
69 - mountPath: {{ .Values.certpersistence.certPath }}
70 name: {{ include "common.fullname" . }}-certs
71 command:
72 - bash
73 - -c
74 - |
75 /opt/app/aaf_config/bin/agent.sh &&
76 cd /opt/app/osaaf/local &&
77 /opt/app/aaf_config/bin/agent.sh local showpass | grep cadi_keystore_password= | cut -d= -f 2 > /opt/app/osaaf/local/.pass 2>&1
78 env:
79 - name: APP_FQI
80 value: "{{ .Values.aaf_init.fqi }}"
81 - name: aaf_locate_url
82 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
83 - name: aaf_locator_container
84 value: "oom"
85 - name: aaf_locator_container_ns
86 value: "{{ .Release.Namespace }}"
87 - name: aaf_locator_fqdn
88 value: "{{ .Values.aaf_init.fqdn }}"
89 - name: aaf_locator_app_ns
90 value: "{{ .Values.aaf_init.app_ns }}"
91 - name: DEPLOY_FQI
92 value: "{{ .Values.aaf_init.deploy_fqi }}"
93 - name: DEPLOY_PASSWORD
94 valueFrom:
95 secretKeyRef:
96 name: {{ template "common.fullname" .}}-aaf
97 key: aaf-password
98 - name: cadi_longitude
99 value: "{{ .Values.aaf_init.cadi_longitude }}"
100 - name: cadi_latitude
101 value: "{{ .Values.aaf_init.cadi_latitude }}"
102 {{ end }}
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400103 - name: {{ include "common.name" . }}-chown
104 image: "busybox"
105 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 }}"]
106 volumeMounts:
107 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100108 name: {{ include "common.fullname" . }}-data
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -0400109 - mountPath: {{ .Values.certpersistence.certPath }}
110 name: {{ include "common.fullname" . }}-certs
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 }}
115 command: ["/bin/bash"]
116 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
117 ports:
118 - containerPort: {{ .Values.service.internalPort }}
119 - containerPort: {{ .Values.service.internalPort2 }}
120 - containerPort: {{ .Values.service.internalPort3 }}
121 - containerPort: {{ .Values.service.clusterPort }}
122 readinessProbe:
123 tcpSocket:
124 port: {{ .Values.service.internalPort }}
125 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
126 periodSeconds: {{ .Values.readiness.periodSeconds }}
127 env:
128 - name: MYSQL_ROOT_PASSWORD
129 valueFrom:
130 secretKeyRef:
131 name: {{ template "common.fullname" . }}
132 key: db-root-password
jmaca68f4cb2018-05-10 22:44:19 +0000133 - name: ODL_ADMIN_PASSWORD
134 valueFrom:
135 secretKeyRef:
136 name: {{ template "common.fullname" . }}-odl
137 key: odl-password
jmac70863e12018-05-16 14:53:03 +0000138 - name: SDNC_DB_PASSWORD
139 valueFrom:
140 secretKeyRef:
141 name: {{ template "common.fullname" . }}-sdnctl
142 key: db-sdnctl-password
jmac065e2ce2018-03-29 01:18:02 +0000143 - name: SDNC_CONFIG_DIR
144 value: "{{ .Values.config.configDir }}"
145 - name: ENABLE_ODL_CLUSTER
146 value: "{{ .Values.config.enableClustering }}"
Trevor Tait567ff1e2018-05-01 16:20:54 -0400147 - 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}}"
Agarwal, Ruchira (ra1926)ec7c75e2019-10-01 17:36:24 +0000155 - name: SDNC_AAF_ENABLED
156 value: "{{ .Values.global.aafEnabled}}"
jmac065e2ce2018-03-29 01:18:02 +0000157 - name: SDNC_REPLICAS
158 value: "{{ .Values.replicaCount }}"
159 - name: MYSQL_HOST
Mahendra Raghuwanshib76cb282019-04-09 10:13:07 +0000160 value: "{{.Values.config.mariadbGalera.serviceName}}.{{.Release.Namespace}}"
Timoney, Dan (dt5972)6819bc92019-02-12 13:30:49 -0500161 - name: JAVA_HOME
162 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000163 volumeMounts:
164 - mountPath: /etc/localtime
165 name: localtime
166 readOnly: true
167 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
168 name: sdnc-logging-cfg-config
169 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000170 - mountPath: {{ .Values.config.binDir }}/startODL.sh
171 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000172 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000173 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
174 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000175 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +0000176 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
177 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000178 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000179 - mountPath: {{ .Values.config.configDir }}/dblib.properties
180 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000181 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000182 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
183 name: properties
184 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000185 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
186 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000187 subPath: svclogic.properties
188 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000189 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000190 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400191 - mountPath: {{ .Values.config.configDir }}/netbox.properties
192 name: properties
193 subPath: netbox.properties
194 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
195 name: properties
196 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000197 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100198 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000199 - mountPath: /var/log/onap
200 name: logs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000201 - mountPath: {{ .Values.certpersistence.certPath }}
202 name: {{ include "common.fullname" . }}-certs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400203 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
204 name: properties
205 subPath: akka.conf
206 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
207 name: properties
208 subPath: org.opendaylight.controller.cluster.datastore.cfg
209 - mountPath: {{ .Values.config.odl.binDir }}/setenv
210 name: properties
211 subPath: setenv
jmac065e2ce2018-03-29 01:18:02 +0000212 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000213{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000214 {{- if .Values.nodeSelector }}
215 nodeSelector:
216{{ toYaml .Values.nodeSelector | indent 10 }}
217 {{- end -}}
218 {{- if .Values.affinity }}
219 affinity:
220{{ toYaml .Values.affinity | indent 10 }}
221 {{- end }}
222
223 # side car containers
224 - name: filebeat-onap
225 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
226 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
227 volumeMounts:
228 - mountPath: /usr/share/filebeat/filebeat.yml
229 name: filebeat-conf
230 subPath: filebeat.yml
231 - mountPath: /var/log/onap
232 name: logs
233 - mountPath: /usr/share/filebeat/data
234 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000235 imagePullSecrets:
236 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000237 volumes:
238 - name: localtime
239 hostPath:
240 path: /etc/localtime
241 - name: logs
242 emptyDir: {}
243 - name: data-filebeat
244 emptyDir: {}
245 - name: filebeat-conf
246 configMap:
247 name: {{ include "common.fullname" . }}-filebeat-configmap
248 - name: sdnc-logging-cfg-config
249 configMap:
250 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000251 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000252 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000253 name: {{ include "common.fullname" . }}-bin
254 defaultMode: 0755
255 - name: properties
jmac065e2ce2018-03-29 01:18:02 +0000256 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000257 name: {{ include "common.fullname" . }}-properties
258 defaultMode: 0644
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000259 - name: {{ include "common.fullname" . }}-certs
260 {{ if .Values.certpersistence.enabled }}
261 persistentVolumeClaim:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100262 claimName: {{ include "common.fullname" . }}-certs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000263 {{ else }}
264 emptyDir: {}
265 {{ end }}
jmac8d6dc962018-04-26 14:26:55 +0000266 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100267 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000268 emptyDir: {}
269 {{ else }}
270 volumeClaimTemplates:
271 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100272 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000273 labels:
274 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100275 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
276 release: "{{ .Release.Name }}"
277 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000278 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100279 accessModes:
280 - {{ .Values.persistence.accessMode }}
281 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000282 resources:
283 requests:
284 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100285 {{- end }}