blob: 208315495b27c5ab3b3bd1256bfffc8521afe874 [file] [log] [blame]
Jakub Latusek647e2cf2020-10-21 13:27:09 +02001{{/*
Mukul2b4e7532018-08-03 10:41:29 +00002# Copyright © 2018 AT&T, Amdocs, Bell Canada Intellectual Property. All rights reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Jakub Latusek647e2cf2020-10-21 13:27:09 +020015*/}}
Mukul2b4e7532018-08-03 10:41:29 +000016
kosewski24e52292020-07-14 09:57:53 +000017apiVersion: apps/v1
Mike Elliott13fed112018-02-28 08:33:33 -050018kind: StatefulSet
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050026 heritage: {{ .Release.Service }}
27spec:
kosewski24e52292020-07-14 09:57:53 +000028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050031 serviceName: "{{ .Values.service.name }}-cluster"
32 replicas: {{ .Values.replicaCount }}
33 podManagementPolicy: Parallel
34 template:
35 metadata:
36 labels:
37 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010038 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050039 spec:
40 initContainers:
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010041 - command:
42 - sh
43 args:
44 - -c
45 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; chmod 0755 /config/${PFILE}; done"
46 env:
47 - name: APPC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010049 - name: APPC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010051 - name: SDNC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010053 - name: SDNC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010054 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010055 volumeMounts:
56 - mountPath: /config-input/appc-data-properties
57 name: onap-appc-data-properties-input
58 - mountPath: /config-input/appc-svclogic-config
59 name: onap-appc-svclogic-config-input
60 - mountPath: /config-input/sdnc-data-properties
61 name: onap-sdnc-data-properties-input
62 - mountPath: /config-input/sdnc-svclogic-config
63 name: onap-sdnc-svclogic-config-input
64 - mountPath: /config/appc-data-properties
65 name: onap-appc-data-properties
66 - mountPath: /config/appc-svclogic-config
67 name: onap-appc-svclogic-config
68 - mountPath: /config/sdnc-data-properties
69 name: onap-sdnc-data-properties
70 - mountPath: /config/sdnc-svclogic-config
71 name: onap-sdnc-svclogic-config
Sylvain Desbureaux856fce12020-11-21 22:48:15 +010072 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010073 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
74 name: {{ include "common.name" . }}-update-config
75
Taka Cho31eb2452019-06-24 21:10:50 -040076 - name: {{ include "common.name" . }}-readiness
77 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020078 - /app/ready.py
Mike Elliott13fed112018-02-28 08:33:33 -050079 args:
80 - --container-name
pramod47b1b822018-08-28 15:41:45 +000081 - {{.Values.config.mariadbGaleraContName}}
Mike Elliott13fed112018-02-28 08:33:33 -050082 env:
83 - name: NAMESPACE
84 valueFrom:
85 fieldRef:
86 apiVersion: v1
87 fieldPath: metadata.namespace
Sylvain Desbureaux856fce12020-11-21 22:48:15 +010088 image: {{ include "repositoryGenerator.image.readiness" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050089 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho31eb2452019-06-24 21:10:50 -040090 - name: {{ include "common.name" . }}-chown
Sylvain Desbureaux856fce12020-11-21 22:48:15 +010091 image: {{ include "repositoryGenerator.image.busybox" . }}
Taka Cho31eb2452019-06-24 21:10:50 -040092 command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}"]
93 volumeMounts:
94 - mountPath: {{ .Values.persistence.mdsalPath }}
95 name: {{ include "common.fullname" . }}-data
Mike Elliott13fed112018-02-28 08:33:33 -050096 containers:
97 - name: {{ include "common.name" . }}
Sylvain Desbureaux856fce12020-11-21 22:48:15 +010098 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Mike Elliott13fed112018-02-28 08:33:33 -050099 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
100 command:
101 - /opt/appc/bin/startODL.sh
102 ports:
103 - containerPort: {{ .Values.service.internalPort }}
104 - containerPort: {{ .Values.service.externalPort2 }}
105 readinessProbe:
Taka Chocdc42662019-11-08 16:08:38 -0500106 tcpSocket:
107 port: {{ .Values.service.internalPort }}
Mike Elliott13fed112018-02-28 08:33:33 -0500108 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
109 periodSeconds: {{ .Values.readiness.periodSeconds }}
110 env:
111 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100112 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-pass" "key" "password") | indent 14}}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100113 - name: APPC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100114 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "login") | indent 14 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100115 - name: APPC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100116 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "password") | indent 14 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100117 - name: SDNC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100118 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "login") | indent 14 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100119 - name: SDNC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100120 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "password") | indent 14 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500121 - name: SDNC_CONFIG_DIR
122 value: "{{ .Values.config.configDir }}"
123 - name: APPC_CONFIG_DIR
124 value: "{{ .Values.config.configDir }}"
125 - name: DMAAP_TOPIC_ENV
126 value: "{{ .Values.config.dmaapTopic }}"
Aaron Hay145818b2018-06-05 13:23:50 -0400127 - name: ENABLE_AAF
128 value: "{{ .Values.config.enableAAF }}"
Mike Elliott13fed112018-02-28 08:33:33 -0500129 - name: ENABLE_ODL_CLUSTER
130 value: "{{ .Values.config.enableClustering }}"
131 - name: APPC_REPLICAS
132 value: "{{ .Values.replicaCount }}"
133 volumeMounts:
134 - mountPath: /etc/localtime
135 name: localtime
136 readOnly: true
137 - mountPath: /opt/onap/appc/data/properties/dblib.properties
138 name: onap-appc-data-properties
139 subPath: dblib.properties
140 - mountPath: /opt/onap/appc/data/properties/svclogic.properties
141 name: onap-appc-data-properties
142 subPath: svclogic.properties
143 - mountPath: /opt/onap/appc/data/properties/appc.properties
144 name: onap-appc-data-properties
145 subPath: appc.properties
146 - mountPath: /opt/onap/appc/data/properties/aaiclient.properties
147 name: onap-appc-data-properties
148 subPath: aaiclient.properties
Aaron Hay3395df22018-10-30 18:31:41 -0400149 - mountPath: /opt/onap/appc/data/properties/cadi.properties
150 name: onap-appc-data-properties
151 subPath: cadi.properties
Aaron Hay145818b2018-06-05 13:23:50 -0400152 - mountPath: /opt/onap/appc/data/properties/aaa-app-config.xml
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100153 name: onap-appc-data-properties-input
Aaron Hay145818b2018-06-05 13:23:50 -0400154 subPath: aaa-app-config.xml
Taka Cho870b9432019-08-23 15:14:41 -0400155 - mountPath: /opt/onap/appc/data/properties/bath_config.csv
156 name: onap-appc-data-properties
157 subPath: bath_config.csv
Mike Elliott13fed112018-02-28 08:33:33 -0500158 - mountPath: /opt/onap/appc/svclogic/config/svclogic.properties
159 name: onap-appc-svclogic-config
160 subPath: svclogic.properties
161 - mountPath: /opt/onap/appc/svclogic/bin/showActiveGraphs.sh
162 name: onap-appc-svclogic-bin
163 subPath: showActiveGraphs.sh
164 - mountPath: /opt/onap/appc/bin/startODL.sh
165 name: onap-appc-bin
166 subPath: startODL.sh
167 - mountPath: /opt/onap/appc/bin/installAppcDb.sh
168 name: onap-appc-bin
169 subPath: installAppcDb.sh
Aaron Hay1d464b52018-05-25 14:58:32 -0400170 - mountPath: /opt/onap/appc/bin/health_check.sh
171 name: onap-appc-bin
172 subPath: health_check.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400173 - mountPath: /opt/onap/ccsdk/data/properties/dblib.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500174 name: onap-sdnc-data-properties
175 subPath: dblib.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400176 - mountPath: /opt/onap/ccsdk/data/properties/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500177 name: onap-sdnc-data-properties
178 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400179 - mountPath: /opt/onap/ccsdk/data/properties/aaiclient.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500180 name: onap-sdnc-data-properties
181 subPath: aaiclient.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400182 - mountPath: /opt/onap/ccsdk/svclogic/config/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500183 name: onap-sdnc-svclogic-config
184 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400185 - mountPath: /opt/onap/ccsdk/svclogic/bin/showActiveGraphs.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500186 name: onap-sdnc-svclogic-bin
187 subPath: showActiveGraphs.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400188 - mountPath: /opt/onap/ccsdk/bin/installSdncDb.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500189 name: onap-sdnc-bin
190 subPath: installSdncDb.sh
BorislavG3dad2f42018-04-16 10:19:45 +0000191 - mountPath: {{ .Values.persistence.mdsalPath }}
192 name: {{ include "common.fullname" . }}-data
Sylvain Desbureaux531d03f2020-04-22 10:37:45 +0200193 - mountPath: {{ .Values.log.path }}
Mike Elliott13fed112018-02-28 08:33:33 -0500194 name: logs
Taka Choe1e2e1c2019-09-17 13:42:28 -0400195 - mountPath: /opt/onap/appc/data/org.ops4j.pax.logging.cfg
Mike Elliott13fed112018-02-28 08:33:33 -0500196 name: log-config
197 subPath: org.ops4j.pax.logging.cfg
Taka Choc6559a92020-03-31 13:52:56 -0400198 - mountPath: /opt/onap/appc/data/stores/org.onap.appc.p12
199 name: p12-certs
200 subPath: org.onap.appc.p12
201 - mountPath: /opt/onap/appc/data/stores/org.onap.appc.keyfile
202 name: keyfile-certs
203 subPath: org.onap.appc.keyfile
Mike Elliott13fed112018-02-28 08:33:33 -0500204 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000205{{ include "common.resources" . | indent 12 }}
GregSulek973bfad2018-09-19 06:48:37 -0400206 {{- if .Values.nodeSelector }}
Mike Elliott13fed112018-02-28 08:33:33 -0500207 nodeSelector:
208{{ toYaml .Values.nodeSelector | indent 10 }}
209 {{- end -}}
210 {{- if .Values.affinity }}
211 affinity:
212{{ toYaml .Values.affinity | indent 10 }}
213 {{- end }}
214
215 # side car containers
Sylvain Desbureaux531d03f2020-04-22 10:37:45 +0200216 {{ include "common.log.sidecar" . | nindent 8 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500217 volumes:
Taka Choc6559a92020-03-31 13:52:56 -0400218 - name: keyfile-certs
219 secret:
220 secretName: {{ include "common.fullname" . }}-certs
221 - name: p12-certs
222 secret:
223 secretName: {{ include "common.fullname" . }}-certs
Mike Elliott13fed112018-02-28 08:33:33 -0500224 - name: localtime
225 hostPath:
226 path: /etc/localtime
Mike Elliott13fed112018-02-28 08:33:33 -0500227 - name: log-config
228 configMap:
229 name: {{ include "common.fullname" . }}-logging-cfg
230 - name: logs
231 emptyDir: {}
Sylvain Desbureaux531d03f2020-04-22 10:37:45 +0200232 {{ include "common.log.volumes" . | nindent 8 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100233 - name: onap-appc-data-properties-input
Mike Elliott13fed112018-02-28 08:33:33 -0500234 configMap:
235 name: {{ include "common.fullname" . }}-onap-appc-data-properties
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100236 - name: onap-appc-svclogic-config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500237 configMap:
238 name: {{ include "common.fullname" . }}-onap-appc-svclogic-config
239 - name: onap-appc-svclogic-bin
240 configMap:
241 name: {{ include "common.fullname" . }}-onap-appc-svclogic-bin
242 defaultMode: 0755
243 - name: onap-appc-bin
244 configMap:
245 name: {{ include "common.fullname" . }}-onap-appc-bin
246 defaultMode: 0755
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100247 - name: onap-sdnc-data-properties-input
Mike Elliott13fed112018-02-28 08:33:33 -0500248 configMap:
249 name: {{ include "common.fullname" . }}-onap-sdnc-data-properties
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100250 - name: onap-sdnc-svclogic-config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500251 configMap:
252 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-config
253 - name: onap-sdnc-svclogic-bin
254 configMap:
255 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-bin
256 defaultMode: 0755
257 - name: onap-sdnc-bin
258 configMap:
259 name: {{ include "common.fullname" . }}-onap-sdnc-bin
260 defaultMode: 0755
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100261 - name: onap-appc-data-properties
262 emptyDir:
263 medium: Memory
264 - name: onap-appc-svclogic-config
265 emptyDir:
266 medium: Memory
267 - name: onap-sdnc-data-properties
268 emptyDir:
269 medium: Memory
270 - name: onap-sdnc-svclogic-config
271 emptyDir:
272 medium: Memory
BorislavG8b31f6d2018-05-02 14:06:08 +0000273{{ if not .Values.persistence.enabled }}
BorislavG3dad2f42018-04-16 10:19:45 +0000274 - name: {{ include "common.fullname" . }}-data
275 emptyDir: {}
BorislavG8b31f6d2018-05-02 14:06:08 +0000276{{ else }}
BorislavG3dad2f42018-04-16 10:19:45 +0000277 volumeClaimTemplates:
278 - metadata:
279 name: {{ include "common.fullname" . }}-data
280 labels:
281 name: {{ include "common.fullname" . }}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100282 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100283 release: "{{ include "common.release" . }}"
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100284 heritage: "{{ .Release.Service }}"
BorislavG3dad2f42018-04-16 10:19:45 +0000285 spec:
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100286 accessModes:
287 - {{ .Values.persistence.accessMode }}
288 storageClassName: {{ include "common.storageClass" . }}
BorislavG3dad2f42018-04-16 10:19:45 +0000289 resources:
290 requests:
291 storage: {{ .Values.persistence.size }}
BorislavG8b31f6d2018-05-02 14:06:08 +0000292{{ end }}