blob: 4ab8d1ccfebeb81c086ab701da6c0e5b79866345 [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
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -040050 - name: {{ include "common.name" . }}-chown
51 image: "busybox"
52 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 }}"]
53 volumeMounts:
54 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +010055 name: {{ include "common.fullname" . }}-data
Timoney, Dan (dt5972)ba4d2eb2019-05-07 13:32:42 -040056 - mountPath: {{ .Values.certpersistence.certPath }}
57 name: {{ include "common.fullname" . }}-certs
jmac065e2ce2018-03-29 01:18:02 +000058 containers:
59 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000060 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +000061 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 command: ["/bin/bash"]
63 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
64 ports:
65 - containerPort: {{ .Values.service.internalPort }}
66 - containerPort: {{ .Values.service.internalPort2 }}
67 - containerPort: {{ .Values.service.internalPort3 }}
68 - containerPort: {{ .Values.service.clusterPort }}
69 readinessProbe:
70 tcpSocket:
71 port: {{ .Values.service.internalPort }}
72 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
73 periodSeconds: {{ .Values.readiness.periodSeconds }}
74 env:
75 - name: MYSQL_ROOT_PASSWORD
76 valueFrom:
77 secretKeyRef:
78 name: {{ template "common.fullname" . }}
79 key: db-root-password
jmaca68f4cb2018-05-10 22:44:19 +000080 - name: ODL_ADMIN_PASSWORD
81 valueFrom:
82 secretKeyRef:
83 name: {{ template "common.fullname" . }}-odl
84 key: odl-password
jmac70863e12018-05-16 14:53:03 +000085 - name: SDNC_DB_PASSWORD
86 valueFrom:
87 secretKeyRef:
88 name: {{ template "common.fullname" . }}-sdnctl
89 key: db-sdnctl-password
jmac065e2ce2018-03-29 01:18:02 +000090 - name: SDNC_CONFIG_DIR
91 value: "{{ .Values.config.configDir }}"
92 - name: ENABLE_ODL_CLUSTER
93 value: "{{ .Values.config.enableClustering }}"
Trevor Tait567ff1e2018-05-01 16:20:54 -040094 - name: MY_ODL_CLUSTER
95 value: "{{ .Values.config.myODLCluster }}"
96 - name: PEER_ODL_CLUSTER
97 value: "{{ .Values.config.peerODLCluster }}"
98 - name: IS_PRIMARY_CLUSTER
99 value: "{{ .Values.config.isPrimaryCluster }}"
100 - name: GEO_ENABLED
101 value: "{{ .Values.config.geoEnabled}}"
jmac065e2ce2018-03-29 01:18:02 +0000102 - name: SDNC_REPLICAS
103 value: "{{ .Values.replicaCount }}"
104 - name: MYSQL_HOST
Mahendra Raghuwanshib76cb282019-04-09 10:13:07 +0000105 value: "{{.Values.config.mariadbGalera.serviceName}}.{{.Release.Namespace}}"
Timoney, Dan (dt5972)6819bc92019-02-12 13:30:49 -0500106 - name: JAVA_HOME
107 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000108 volumeMounts:
109 - mountPath: /etc/localtime
110 name: localtime
111 readOnly: true
112 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
113 name: sdnc-logging-cfg-config
114 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000115 - mountPath: {{ .Values.config.binDir }}/startODL.sh
116 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000117 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000118 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
119 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000120 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +0000121 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
122 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000123 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000124 - mountPath: {{ .Values.config.configDir }}/dblib.properties
125 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000126 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000127 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
128 name: properties
129 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000130 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
131 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000132 subPath: svclogic.properties
133 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000134 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000135 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400136 - mountPath: {{ .Values.config.configDir }}/netbox.properties
137 name: properties
138 subPath: netbox.properties
139 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
140 name: properties
141 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000142 - mountPath: {{ .Values.persistence.mdsalPath }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100143 name: {{ include "common.fullname" . }}-data
jmac065e2ce2018-03-29 01:18:02 +0000144 - mountPath: /var/log/onap
145 name: logs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000146 - mountPath: {{ .Values.certpersistence.certPath }}
147 name: {{ include "common.fullname" . }}-certs
Timoney, Dan (dt5972)58774772019-08-21 16:50:54 -0400148 - mountPath: {{ .Values.config.odl.salConfigDir }}/{{ .Values.config.odl.salConfigVersion}}/sal-clustering-config-{{ .Values.config.odl.salConfigVersion}}-akkaconf.xml
149 name: properties
150 subPath: akka.conf
151 - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.controller.cluster.datastore.cfg
152 name: properties
153 subPath: org.opendaylight.controller.cluster.datastore.cfg
154 - mountPath: {{ .Values.config.odl.binDir }}/setenv
155 name: properties
156 subPath: setenv
jmac065e2ce2018-03-29 01:18:02 +0000157 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000158{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000159 {{- if .Values.nodeSelector }}
160 nodeSelector:
161{{ toYaml .Values.nodeSelector | indent 10 }}
162 {{- end -}}
163 {{- if .Values.affinity }}
164 affinity:
165{{ toYaml .Values.affinity | indent 10 }}
166 {{- end }}
167
168 # side car containers
169 - name: filebeat-onap
170 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
171 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
172 volumeMounts:
173 - mountPath: /usr/share/filebeat/filebeat.yml
174 name: filebeat-conf
175 subPath: filebeat.yml
176 - mountPath: /var/log/onap
177 name: logs
178 - mountPath: /usr/share/filebeat/data
179 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000180 imagePullSecrets:
181 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000182 volumes:
183 - name: localtime
184 hostPath:
185 path: /etc/localtime
186 - name: logs
187 emptyDir: {}
188 - name: data-filebeat
189 emptyDir: {}
190 - name: filebeat-conf
191 configMap:
192 name: {{ include "common.fullname" . }}-filebeat-configmap
193 - name: sdnc-logging-cfg-config
194 configMap:
195 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000196 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000197 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000198 name: {{ include "common.fullname" . }}-bin
199 defaultMode: 0755
200 - name: properties
jmac065e2ce2018-03-29 01:18:02 +0000201 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000202 name: {{ include "common.fullname" . }}-properties
203 defaultMode: 0644
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000204 - name: {{ include "common.fullname" . }}-certs
205 {{ if .Values.certpersistence.enabled }}
206 persistentVolumeClaim:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100207 claimName: {{ include "common.fullname" . }}-certs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000208 {{ else }}
209 emptyDir: {}
210 {{ end }}
jmac8d6dc962018-04-26 14:26:55 +0000211 {{ if not .Values.persistence.enabled }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100212 - name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000213 emptyDir: {}
214 {{ else }}
215 volumeClaimTemplates:
216 - metadata:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100217 name: {{ include "common.fullname" . }}-data
jmac8d6dc962018-04-26 14:26:55 +0000218 labels:
219 name: {{ include "common.fullname" . }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100220 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
221 release: "{{ .Release.Name }}"
222 heritage: "{{ .Release.Service }}"
jmac8d6dc962018-04-26 14:26:55 +0000223 spec:
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100224 accessModes:
225 - {{ .Values.persistence.accessMode }}
226 storageClassName: {{ include "common.storageClass" . }}
jmac8d6dc962018-04-26 14:26:55 +0000227 resources:
228 requests:
229 storage: {{ .Values.persistence.size }}
Sylvain Desbureaux25e01d52019-12-09 11:06:39 +0100230 {{- end }}