blob: 5ed2970c45ef1df5cc528e83a29b75025bc15885 [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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050024 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" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050034 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:
Taka Chocdc42662019-11-08 16:08:38 -050066 tcpSocket:
67 port: {{ .Values.service.internalPort }}
Mike Elliott13fed112018-02-28 08:33:33 -050068 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.readiness.periodSeconds }}
70 env:
71 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiake74ed5c2020-01-23 11:49:25 +010072 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-root-pass" "key" "password") | indent 14}}
Mike Elliott13fed112018-02-28 08:33:33 -050073 - name: SDNC_CONFIG_DIR
74 value: "{{ .Values.config.configDir }}"
75 - name: APPC_CONFIG_DIR
76 value: "{{ .Values.config.configDir }}"
77 - name: DMAAP_TOPIC_ENV
78 value: "{{ .Values.config.dmaapTopic }}"
Aaron Hay145818b2018-06-05 13:23:50 -040079 - name: ENABLE_AAF
80 value: "{{ .Values.config.enableAAF }}"
Mike Elliott13fed112018-02-28 08:33:33 -050081 - name: ENABLE_ODL_CLUSTER
82 value: "{{ .Values.config.enableClustering }}"
83 - name: APPC_REPLICAS
84 value: "{{ .Values.replicaCount }}"
85 volumeMounts:
86 - mountPath: /etc/localtime
87 name: localtime
88 readOnly: true
89 - mountPath: /opt/onap/appc/data/properties/dblib.properties
90 name: onap-appc-data-properties
91 subPath: dblib.properties
92 - mountPath: /opt/onap/appc/data/properties/svclogic.properties
93 name: onap-appc-data-properties
94 subPath: svclogic.properties
95 - mountPath: /opt/onap/appc/data/properties/appc.properties
96 name: onap-appc-data-properties
97 subPath: appc.properties
98 - mountPath: /opt/onap/appc/data/properties/aaiclient.properties
99 name: onap-appc-data-properties
100 subPath: aaiclient.properties
Aaron Hay3395df22018-10-30 18:31:41 -0400101 - mountPath: /opt/onap/appc/data/properties/cadi.properties
102 name: onap-appc-data-properties
103 subPath: cadi.properties
Aaron Hay145818b2018-06-05 13:23:50 -0400104 - mountPath: /opt/onap/appc/data/properties/aaa-app-config.xml
105 name: onap-appc-data-properties
106 subPath: aaa-app-config.xml
Taka Cho870b9432019-08-23 15:14:41 -0400107 - mountPath: /opt/onap/appc/data/properties/bath_config.csv
108 name: onap-appc-data-properties
109 subPath: bath_config.csv
Mike Elliott13fed112018-02-28 08:33:33 -0500110 - mountPath: /opt/onap/appc/svclogic/config/svclogic.properties
111 name: onap-appc-svclogic-config
112 subPath: svclogic.properties
113 - mountPath: /opt/onap/appc/svclogic/bin/showActiveGraphs.sh
114 name: onap-appc-svclogic-bin
115 subPath: showActiveGraphs.sh
116 - mountPath: /opt/onap/appc/bin/startODL.sh
117 name: onap-appc-bin
118 subPath: startODL.sh
119 - mountPath: /opt/onap/appc/bin/installAppcDb.sh
120 name: onap-appc-bin
121 subPath: installAppcDb.sh
Aaron Hay1d464b52018-05-25 14:58:32 -0400122 - mountPath: /opt/onap/appc/bin/health_check.sh
123 name: onap-appc-bin
124 subPath: health_check.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400125 - mountPath: /opt/onap/ccsdk/data/properties/dblib.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500126 name: onap-sdnc-data-properties
127 subPath: dblib.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400128 - mountPath: /opt/onap/ccsdk/data/properties/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500129 name: onap-sdnc-data-properties
130 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400131 - mountPath: /opt/onap/ccsdk/data/properties/aaiclient.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500132 name: onap-sdnc-data-properties
133 subPath: aaiclient.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400134 - mountPath: /opt/onap/ccsdk/svclogic/config/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500135 name: onap-sdnc-svclogic-config
136 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400137 - mountPath: /opt/onap/ccsdk/svclogic/bin/showActiveGraphs.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500138 name: onap-sdnc-svclogic-bin
139 subPath: showActiveGraphs.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400140 - mountPath: /opt/onap/ccsdk/bin/installSdncDb.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500141 name: onap-sdnc-bin
142 subPath: installSdncDb.sh
BorislavG3dad2f42018-04-16 10:19:45 +0000143 - mountPath: {{ .Values.persistence.mdsalPath }}
144 name: {{ include "common.fullname" . }}-data
Mike Elliott13fed112018-02-28 08:33:33 -0500145 - mountPath: /var/log/onap
146 name: logs
Taka Choe1e2e1c2019-09-17 13:42:28 -0400147 - mountPath: /opt/onap/appc/data/org.ops4j.pax.logging.cfg
Mike Elliott13fed112018-02-28 08:33:33 -0500148 name: log-config
149 subPath: org.ops4j.pax.logging.cfg
150 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000151{{ include "common.resources" . | indent 12 }}
GregSulek973bfad2018-09-19 06:48:37 -0400152 {{- if .Values.nodeSelector }}
Mike Elliott13fed112018-02-28 08:33:33 -0500153 nodeSelector:
154{{ toYaml .Values.nodeSelector | indent 10 }}
155 {{- end -}}
156 {{- if .Values.affinity }}
157 affinity:
158{{ toYaml .Values.affinity | indent 10 }}
159 {{- end }}
160
161 # side car containers
162 - name: filebeat-onap
163 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
164 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
165 volumeMounts:
166 - mountPath: /usr/share/filebeat/filebeat.yml
167 name: filebeat-conf
168 subPath: filebeat.yml
169 - mountPath: /var/log/onap
170 name: logs
171 - mountPath: /usr/share/filebeat/data
172 name: data-filebeat
173 volumes:
174 - name: localtime
175 hostPath:
176 path: /etc/localtime
177 - name: filebeat-conf
178 configMap:
179 name: {{ include "common.fullname" . }}-filebeat
180 - name: log-config
181 configMap:
182 name: {{ include "common.fullname" . }}-logging-cfg
183 - name: logs
184 emptyDir: {}
185 - name: data-filebeat
186 emptyDir: {}
187 - name: onap-appc-data-properties
188 configMap:
189 name: {{ include "common.fullname" . }}-onap-appc-data-properties
190 - name: onap-appc-svclogic-config
191 configMap:
192 name: {{ include "common.fullname" . }}-onap-appc-svclogic-config
193 - name: onap-appc-svclogic-bin
194 configMap:
195 name: {{ include "common.fullname" . }}-onap-appc-svclogic-bin
196 defaultMode: 0755
197 - name: onap-appc-bin
198 configMap:
199 name: {{ include "common.fullname" . }}-onap-appc-bin
200 defaultMode: 0755
201 - name: onap-sdnc-data-properties
202 configMap:
203 name: {{ include "common.fullname" . }}-onap-sdnc-data-properties
204 - name: onap-sdnc-svclogic-config
205 configMap:
206 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-config
207 - name: onap-sdnc-svclogic-bin
208 configMap:
209 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-bin
210 defaultMode: 0755
211 - name: onap-sdnc-bin
212 configMap:
213 name: {{ include "common.fullname" . }}-onap-sdnc-bin
214 defaultMode: 0755
BorislavG8b31f6d2018-05-02 14:06:08 +0000215{{ if not .Values.persistence.enabled }}
BorislavG3dad2f42018-04-16 10:19:45 +0000216 - name: {{ include "common.fullname" . }}-data
217 emptyDir: {}
BorislavG8b31f6d2018-05-02 14:06:08 +0000218{{ else }}
BorislavG3dad2f42018-04-16 10:19:45 +0000219 volumeClaimTemplates:
220 - metadata:
221 name: {{ include "common.fullname" . }}-data
222 labels:
223 name: {{ include "common.fullname" . }}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100224 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100225 release: "{{ include "common.release" . }}"
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100226 heritage: "{{ .Release.Service }}"
BorislavG3dad2f42018-04-16 10:19:45 +0000227 spec:
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100228 accessModes:
229 - {{ .Values.persistence.accessMode }}
230 storageClassName: {{ include "common.storageClass" . }}
BorislavG3dad2f42018-04-16 10:19:45 +0000231 resources:
232 requests:
233 storage: {{ .Values.persistence.size }}
BorislavG8b31f6d2018-05-02 14:06:08 +0000234{{ end }}