blob: 5b4f63bfa767231e3bc99fe52404d21f1d8e438e [file] [log] [blame]
Mukul2b4e7532018-08-03 10:41:29 +00001# Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved.
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
Mike Elliott13fed112018-02-28 08:33:33 -050015apiVersion: 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:
26 serviceName: "{{ .Values.service.name }}-cluster"
27 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:
Taka Cho31eb2452019-06-24 21:10:50 -040036 - name: {{ include "common.name" . }}-readiness
37 command:
Mike Elliott13fed112018-02-28 08:33:33 -050038 - /root/ready.py
39 args:
40 - --container-name
pramod47b1b822018-08-28 15:41:45 +000041 - {{.Values.config.mariadbGaleraContName}}
Mike Elliott13fed112018-02-28 08:33:33 -050042 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
48 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
49 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho31eb2452019-06-24 21:10:50 -040050 - name: {{ include "common.name" . }}-chown
51 image: "busybox"
52 command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}"]
53 volumeMounts:
54 - mountPath: {{ .Values.persistence.mdsalPath }}
55 name: {{ include "common.fullname" . }}-data
Mike Elliott13fed112018-02-28 08:33:33 -050056 containers:
57 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000058 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mike Elliott13fed112018-02-28 08:33:33 -050059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 command:
61 - /opt/appc/bin/startODL.sh
62 ports:
63 - containerPort: {{ .Values.service.internalPort }}
64 - containerPort: {{ .Values.service.externalPort2 }}
65 readinessProbe:
Aaron Hay1d464b52018-05-25 14:58:32 -040066 exec:
67 command:
68 - /opt/appc/bin/health_check.sh
Mike Elliott13fed112018-02-28 08:33:33 -050069 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
70 periodSeconds: {{ .Values.readiness.periodSeconds }}
71 env:
72 - name: MYSQL_ROOT_PASSWORD
73 valueFrom:
74 secretKeyRef:
75 name: {{ template "common.fullname" . }}
76 key: db-root-password
77 - name: SDNC_CONFIG_DIR
78 value: "{{ .Values.config.configDir }}"
79 - name: APPC_CONFIG_DIR
80 value: "{{ .Values.config.configDir }}"
81 - name: DMAAP_TOPIC_ENV
82 value: "{{ .Values.config.dmaapTopic }}"
Aaron Hay145818b2018-06-05 13:23:50 -040083 - name: ENABLE_AAF
84 value: "{{ .Values.config.enableAAF }}"
Mike Elliott13fed112018-02-28 08:33:33 -050085 - name: ENABLE_ODL_CLUSTER
86 value: "{{ .Values.config.enableClustering }}"
87 - name: APPC_REPLICAS
88 value: "{{ .Values.replicaCount }}"
89 volumeMounts:
90 - mountPath: /etc/localtime
91 name: localtime
92 readOnly: true
93 - mountPath: /opt/onap/appc/data/properties/dblib.properties
94 name: onap-appc-data-properties
95 subPath: dblib.properties
96 - mountPath: /opt/onap/appc/data/properties/svclogic.properties
97 name: onap-appc-data-properties
98 subPath: svclogic.properties
99 - mountPath: /opt/onap/appc/data/properties/appc.properties
100 name: onap-appc-data-properties
101 subPath: appc.properties
102 - mountPath: /opt/onap/appc/data/properties/aaiclient.properties
103 name: onap-appc-data-properties
104 subPath: aaiclient.properties
Aaron Hay3395df22018-10-30 18:31:41 -0400105 - mountPath: /opt/onap/appc/data/properties/cadi.properties
106 name: onap-appc-data-properties
107 subPath: cadi.properties
Aaron Hay145818b2018-06-05 13:23:50 -0400108 - mountPath: /opt/onap/appc/data/properties/aaa-app-config.xml
109 name: onap-appc-data-properties
110 subPath: aaa-app-config.xml
Taka Cho870b9432019-08-23 15:14:41 -0400111 - mountPath: /opt/onap/appc/data/properties/bath_config.csv
112 name: onap-appc-data-properties
113 subPath: bath_config.csv
Mike Elliott13fed112018-02-28 08:33:33 -0500114 - mountPath: /opt/onap/appc/svclogic/config/svclogic.properties
115 name: onap-appc-svclogic-config
116 subPath: svclogic.properties
117 - mountPath: /opt/onap/appc/svclogic/bin/showActiveGraphs.sh
118 name: onap-appc-svclogic-bin
119 subPath: showActiveGraphs.sh
120 - mountPath: /opt/onap/appc/bin/startODL.sh
121 name: onap-appc-bin
122 subPath: startODL.sh
123 - mountPath: /opt/onap/appc/bin/installAppcDb.sh
124 name: onap-appc-bin
125 subPath: installAppcDb.sh
Aaron Hay1d464b52018-05-25 14:58:32 -0400126 - mountPath: /opt/onap/appc/bin/health_check.sh
127 name: onap-appc-bin
128 subPath: health_check.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400129 - mountPath: /opt/onap/ccsdk/data/properties/dblib.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500130 name: onap-sdnc-data-properties
131 subPath: dblib.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400132 - mountPath: /opt/onap/ccsdk/data/properties/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500133 name: onap-sdnc-data-properties
134 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400135 - mountPath: /opt/onap/ccsdk/data/properties/aaiclient.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500136 name: onap-sdnc-data-properties
137 subPath: aaiclient.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400138 - mountPath: /opt/onap/ccsdk/svclogic/config/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500139 name: onap-sdnc-svclogic-config
140 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400141 - mountPath: /opt/onap/ccsdk/svclogic/bin/showActiveGraphs.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500142 name: onap-sdnc-svclogic-bin
143 subPath: showActiveGraphs.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400144 - mountPath: /opt/onap/ccsdk/bin/installSdncDb.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500145 name: onap-sdnc-bin
146 subPath: installSdncDb.sh
BorislavG3dad2f42018-04-16 10:19:45 +0000147 - mountPath: {{ .Values.persistence.mdsalPath }}
148 name: {{ include "common.fullname" . }}-data
Mike Elliott13fed112018-02-28 08:33:33 -0500149 - mountPath: /var/log/onap
150 name: logs
151 - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
152 name: log-config
153 subPath: org.ops4j.pax.logging.cfg
154 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000155{{ include "common.resources" . | indent 12 }}
GregSulek973bfad2018-09-19 06:48:37 -0400156 {{- if .Values.nodeSelector }}
Mike Elliott13fed112018-02-28 08:33:33 -0500157 nodeSelector:
158{{ toYaml .Values.nodeSelector | indent 10 }}
159 {{- end -}}
160 {{- if .Values.affinity }}
161 affinity:
162{{ toYaml .Values.affinity | indent 10 }}
163 {{- end }}
164
165 # side car containers
166 - name: filebeat-onap
167 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
168 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
169 volumeMounts:
170 - mountPath: /usr/share/filebeat/filebeat.yml
171 name: filebeat-conf
172 subPath: filebeat.yml
173 - mountPath: /var/log/onap
174 name: logs
175 - mountPath: /usr/share/filebeat/data
176 name: data-filebeat
177 volumes:
178 - name: localtime
179 hostPath:
180 path: /etc/localtime
181 - name: filebeat-conf
182 configMap:
183 name: {{ include "common.fullname" . }}-filebeat
184 - name: log-config
185 configMap:
186 name: {{ include "common.fullname" . }}-logging-cfg
187 - name: logs
188 emptyDir: {}
189 - name: data-filebeat
190 emptyDir: {}
191 - name: onap-appc-data-properties
192 configMap:
193 name: {{ include "common.fullname" . }}-onap-appc-data-properties
194 - name: onap-appc-svclogic-config
195 configMap:
196 name: {{ include "common.fullname" . }}-onap-appc-svclogic-config
197 - name: onap-appc-svclogic-bin
198 configMap:
199 name: {{ include "common.fullname" . }}-onap-appc-svclogic-bin
200 defaultMode: 0755
201 - name: onap-appc-bin
202 configMap:
203 name: {{ include "common.fullname" . }}-onap-appc-bin
204 defaultMode: 0755
205 - name: onap-sdnc-data-properties
206 configMap:
207 name: {{ include "common.fullname" . }}-onap-sdnc-data-properties
208 - name: onap-sdnc-svclogic-config
209 configMap:
210 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-config
211 - name: onap-sdnc-svclogic-bin
212 configMap:
213 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-bin
214 defaultMode: 0755
215 - name: onap-sdnc-bin
216 configMap:
217 name: {{ include "common.fullname" . }}-onap-sdnc-bin
218 defaultMode: 0755
BorislavG8b31f6d2018-05-02 14:06:08 +0000219{{ if not .Values.persistence.enabled }}
BorislavG3dad2f42018-04-16 10:19:45 +0000220 - name: {{ include "common.fullname" . }}-data
221 emptyDir: {}
BorislavG8b31f6d2018-05-02 14:06:08 +0000222{{ else }}
BorislavG3dad2f42018-04-16 10:19:45 +0000223 volumeClaimTemplates:
224 - metadata:
225 name: {{ include "common.fullname" . }}-data
226 labels:
227 name: {{ include "common.fullname" . }}
228 spec:
229 accessModes: [ {{ .Values.persistence.accessMode }} ]
230 storageClassName: {{ include "common.fullname" . }}-data
231 resources:
232 requests:
233 storage: {{ .Values.persistence.size }}
BorislavG8b31f6d2018-05-02 14:06:08 +0000234{{ end }}