blob: 24ca832d2464380aad915acee62dcfeeef50a0e3 [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
40 - {{ .Values.mysql.nameOverride }}
41 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 }}
49 name: {{ include "common.name" . }}-readiness
50 containers:
51 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000052 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
jmac065e2ce2018-03-29 01:18:02 +000053 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54 command: ["/bin/bash"]
55 args: ["-c", "/opt/sdnc/bin/startODL.sh"]
56 ports:
57 - containerPort: {{ .Values.service.internalPort }}
58 - containerPort: {{ .Values.service.internalPort2 }}
59 - containerPort: {{ .Values.service.internalPort3 }}
60 - containerPort: {{ .Values.service.clusterPort }}
61 readinessProbe:
62 tcpSocket:
63 port: {{ .Values.service.internalPort }}
64 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.readiness.periodSeconds }}
66 env:
67 - name: MYSQL_ROOT_PASSWORD
68 valueFrom:
69 secretKeyRef:
70 name: {{ template "common.fullname" . }}
71 key: db-root-password
jmaca68f4cb2018-05-10 22:44:19 +000072 - name: ODL_ADMIN_PASSWORD
73 valueFrom:
74 secretKeyRef:
75 name: {{ template "common.fullname" . }}-odl
76 key: odl-password
jmac70863e12018-05-16 14:53:03 +000077 - name: SDNC_DB_PASSWORD
78 valueFrom:
79 secretKeyRef:
80 name: {{ template "common.fullname" . }}-sdnctl
81 key: db-sdnctl-password
jmac065e2ce2018-03-29 01:18:02 +000082 - name: SDNC_CONFIG_DIR
83 value: "{{ .Values.config.configDir }}"
84 - name: ENABLE_ODL_CLUSTER
85 value: "{{ .Values.config.enableClustering }}"
Trevor Tait567ff1e2018-05-01 16:20:54 -040086 - name: MY_ODL_CLUSTER
87 value: "{{ .Values.config.myODLCluster }}"
88 - name: PEER_ODL_CLUSTER
89 value: "{{ .Values.config.peerODLCluster }}"
90 - name: IS_PRIMARY_CLUSTER
91 value: "{{ .Values.config.isPrimaryCluster }}"
92 - name: GEO_ENABLED
93 value: "{{ .Values.config.geoEnabled}}"
jmac065e2ce2018-03-29 01:18:02 +000094 - name: SDNC_REPLICAS
95 value: "{{ .Values.replicaCount }}"
96 - name: MYSQL_HOST
Mohammadreza Pasandideh81ae0b42018-05-15 17:17:44 -040097 value: "{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}"
Timoney, Dan (dt5972)6819bc92019-02-12 13:30:49 -050098 - name: JAVA_HOME
99 value: "{{ .Values.config.javaHome}}"
jmac065e2ce2018-03-29 01:18:02 +0000100 volumeMounts:
101 - mountPath: /etc/localtime
102 name: localtime
103 readOnly: true
104 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
105 name: sdnc-logging-cfg-config
106 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000107 - mountPath: {{ .Values.config.binDir }}/startODL.sh
108 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000109 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000110 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
111 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000112 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +0000113 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
114 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000115 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000116 - mountPath: {{ .Values.config.configDir }}/dblib.properties
117 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000118 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000119 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
120 name: properties
121 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000122 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
123 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000124 subPath: svclogic.properties
125 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000126 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000127 subPath: svclogic.properties
Alexis de Talhouët43c67e02018-09-20 16:49:16 -0400128 - mountPath: {{ .Values.config.configDir }}/netbox.properties
129 name: properties
130 subPath: netbox.properties
131 - mountPath: {{ .Values.config.configDir }}/blueprints-processor-adaptor.properties
132 name: properties
133 subPath: blueprints-processor-adaptor.properties
jmac8d6dc962018-04-26 14:26:55 +0000134 - mountPath: {{ .Values.persistence.mdsalPath }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400135 name: {{ include "common.fullname" . }}-mdsal
jmac065e2ce2018-03-29 01:18:02 +0000136 - mountPath: /var/log/onap
137 name: logs
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000138 - mountPath: {{ .Values.certpersistence.certPath }}
139 name: {{ include "common.fullname" . }}-certs
jmac065e2ce2018-03-29 01:18:02 +0000140 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000141{{ include "common.resources" . | indent 12 }}
jmac065e2ce2018-03-29 01:18:02 +0000142 {{- if .Values.nodeSelector }}
143 nodeSelector:
144{{ toYaml .Values.nodeSelector | indent 10 }}
145 {{- end -}}
146 {{- if .Values.affinity }}
147 affinity:
148{{ toYaml .Values.affinity | indent 10 }}
149 {{- end }}
150
151 # side car containers
152 - name: filebeat-onap
153 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
154 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
155 volumeMounts:
156 - mountPath: /usr/share/filebeat/filebeat.yml
157 name: filebeat-conf
158 subPath: filebeat.yml
159 - mountPath: /var/log/onap
160 name: logs
161 - mountPath: /usr/share/filebeat/data
162 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000163 imagePullSecrets:
164 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000165 volumes:
166 - name: localtime
167 hostPath:
168 path: /etc/localtime
169 - name: logs
170 emptyDir: {}
171 - name: data-filebeat
172 emptyDir: {}
173 - name: filebeat-conf
174 configMap:
175 name: {{ include "common.fullname" . }}-filebeat-configmap
176 - name: sdnc-logging-cfg-config
177 configMap:
178 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000179 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000180 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000181 name: {{ include "common.fullname" . }}-bin
182 defaultMode: 0755
183 - name: properties
jmac065e2ce2018-03-29 01:18:02 +0000184 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000185 name: {{ include "common.fullname" . }}-properties
186 defaultMode: 0644
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000187 - name: {{ include "common.fullname" . }}-certs
188 {{ if .Values.certpersistence.enabled }}
189 persistentVolumeClaim:
190 claimName: {{ include "common.fullname" . }}-pvc-certs
191 {{ else }}
192 emptyDir: {}
193 {{ end }}
jmac8d6dc962018-04-26 14:26:55 +0000194 {{ if not .Values.persistence.enabled }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400195 - name: {{ include "common.fullname" . }}-mdsal
jmac8d6dc962018-04-26 14:26:55 +0000196 emptyDir: {}
197 {{ else }}
198 volumeClaimTemplates:
199 - metadata:
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400200 name: {{ include "common.fullname" . }}-mdsal
jmac8d6dc962018-04-26 14:26:55 +0000201 labels:
202 name: {{ include "common.fullname" . }}
203 spec:
204 accessModes: [ {{ .Values.persistence.accessMode }} ]
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400205 storageClassName: {{ include "common.fullname" . }}-mdsal
jmac8d6dc962018-04-26 14:26:55 +0000206 resources:
207 requests:
208 storage: {{ .Values.persistence.size }}
Alexis de Talhouët634b4552018-10-28 21:56:33 -0400209 selector:
210 matchLabels:
211 name: {{ include "common.fullname" . }}
Rahul Tyagi44cc1ac2019-03-02 06:15:35 +0000212 {{ end }}