blob: 69816dffb49ce9438a1fe67ccd01e1df9346e5bb [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
jmac065e2ce2018-03-29 01:18:02 +000077 - name: SDNC_CONFIG_DIR
78 value: "{{ .Values.config.configDir }}"
79 - name: ENABLE_ODL_CLUSTER
80 value: "{{ .Values.config.enableClustering }}"
Trevor Tait567ff1e2018-05-01 16:20:54 -040081 - name: MY_ODL_CLUSTER
82 value: "{{ .Values.config.myODLCluster }}"
83 - name: PEER_ODL_CLUSTER
84 value: "{{ .Values.config.peerODLCluster }}"
85 - name: IS_PRIMARY_CLUSTER
86 value: "{{ .Values.config.isPrimaryCluster }}"
87 - name: GEO_ENABLED
88 value: "{{ .Values.config.geoEnabled}}"
jmac065e2ce2018-03-29 01:18:02 +000089 - name: SDNC_REPLICAS
90 value: "{{ .Values.replicaCount }}"
91 - name: MYSQL_HOST
Mohammadreza Pasandideh81ae0b42018-05-15 17:17:44 -040092 value: "{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}"
jmac065e2ce2018-03-29 01:18:02 +000093 volumeMounts:
94 - mountPath: /etc/localtime
95 name: localtime
96 readOnly: true
97 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
98 name: sdnc-logging-cfg-config
99 subPath: org.ops4j.pax.logging.cfg
jmaca68f4cb2018-05-10 22:44:19 +0000100 - mountPath: {{ .Values.config.binDir }}/startODL.sh
101 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000102 subPath: startODL.sh
jmaca68f4cb2018-05-10 22:44:19 +0000103 - mountPath: {{ .Values.config.binDir }}/installSdncDb.sh
104 name: bin
jmac065e2ce2018-03-29 01:18:02 +0000105 subPath: installSdncDb.sh
jmaca68f4cb2018-05-10 22:44:19 +0000106 - mountPath: {{ .Values.config.configDir }}/aaiclient.properties
107 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000108 subPath: aaiclient.properties
jmaca68f4cb2018-05-10 22:44:19 +0000109 - mountPath: {{ .Values.config.configDir }}/dblib.properties
110 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000111 subPath: dblib.properties
jmac7c434672018-05-11 20:14:17 +0000112 - mountPath: {{ .Values.config.configDir }}/lcm-dg.properties
113 name: properties
114 subPath: lcm-dg.properties
jmaca68f4cb2018-05-10 22:44:19 +0000115 - mountPath: {{ .Values.config.configDir }}/svclogic.properties
116 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000117 subPath: svclogic.properties
118 - mountPath: /opt/onap/sdnc/svclogic/config/svclogic.properties
jmaca68f4cb2018-05-10 22:44:19 +0000119 name: properties
jmac065e2ce2018-03-29 01:18:02 +0000120 subPath: svclogic.properties
jmac8d6dc962018-04-26 14:26:55 +0000121 - mountPath: {{ .Values.persistence.mdsalPath }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400122 name: {{ include "common.fullname" . }}-mdsal
jmac065e2ce2018-03-29 01:18:02 +0000123 - mountPath: /var/log/onap
124 name: logs
125 resources:
126{{ toYaml .Values.resources | indent 12 }}
127 {{- if .Values.nodeSelector }}
128 nodeSelector:
129{{ toYaml .Values.nodeSelector | indent 10 }}
130 {{- end -}}
131 {{- if .Values.affinity }}
132 affinity:
133{{ toYaml .Values.affinity | indent 10 }}
134 {{- end }}
135
136 # side car containers
137 - name: filebeat-onap
138 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
139 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
140 volumeMounts:
141 - mountPath: /usr/share/filebeat/filebeat.yml
142 name: filebeat-conf
143 subPath: filebeat.yml
144 - mountPath: /var/log/onap
145 name: logs
146 - mountPath: /usr/share/filebeat/data
147 name: data-filebeat
jmac8d6dc962018-04-26 14:26:55 +0000148 imagePullSecrets:
149 - name: "{{ include "common.namespace" . }}-docker-registry-key"
jmac065e2ce2018-03-29 01:18:02 +0000150 volumes:
151 - name: localtime
152 hostPath:
153 path: /etc/localtime
154 - name: logs
155 emptyDir: {}
156 - name: data-filebeat
157 emptyDir: {}
158 - name: filebeat-conf
159 configMap:
160 name: {{ include "common.fullname" . }}-filebeat-configmap
161 - name: sdnc-logging-cfg-config
162 configMap:
163 name: {{ include "common.fullname" . }}-log-configmap
jmaca68f4cb2018-05-10 22:44:19 +0000164 - name: bin
jmac065e2ce2018-03-29 01:18:02 +0000165 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000166 name: {{ include "common.fullname" . }}-bin
167 defaultMode: 0755
168 - name: properties
jmac065e2ce2018-03-29 01:18:02 +0000169 configMap:
jmaca68f4cb2018-05-10 22:44:19 +0000170 name: {{ include "common.fullname" . }}-properties
171 defaultMode: 0644
jmac8d6dc962018-04-26 14:26:55 +0000172 {{ if not .Values.persistence.enabled }}
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400173 - name: {{ include "common.fullname" . }}-mdsal
jmac8d6dc962018-04-26 14:26:55 +0000174 emptyDir: {}
175 {{ else }}
176 volumeClaimTemplates:
177 - metadata:
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400178 name: {{ include "common.fullname" . }}-mdsal
jmac8d6dc962018-04-26 14:26:55 +0000179 labels:
180 name: {{ include "common.fullname" . }}
181 spec:
182 accessModes: [ {{ .Values.persistence.accessMode }} ]
Mohammadreza Pasandidehcffec6d2018-05-08 17:42:11 -0400183 storageClassName: {{ include "common.fullname" . }}-mdsal
jmac8d6dc962018-04-26 14:26:55 +0000184 resources:
185 requests:
186 storage: {{ .Values.persistence.size }}
BorislavGdf11cd52018-05-06 12:55:20 +0000187 {{ end }}