blob: 23aef1da364219d4839f1543504f1cd469c9027a [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
kosewski24e52292020-07-14 09:57:53 +000015apiVersion: apps/v1
Mike Elliott13fed112018-02-28 08:33:33 -050016kind: 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:
kosewski24e52292020-07-14 09:57:53 +000026 selector:
27 matchLabels:
28 app: {{ include "common.name" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050029 serviceName: "{{ .Values.service.name }}-cluster"
30 replicas: {{ .Values.replicaCount }}
31 podManagementPolicy: Parallel
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
Mike Elliott13fed112018-02-28 08:33:33 -050037 spec:
38 initContainers:
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010039 - command:
40 - sh
41 args:
42 - -c
43 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; chmod 0755 /config/${PFILE}; done"
44 env:
45 - name: APPC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010046 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010047 - name: APPC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010049 - name: SDNC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "login") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010051 - name: SDNC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "password") | indent 10 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +010053 volumeMounts:
54 - mountPath: /config-input/appc-data-properties
55 name: onap-appc-data-properties-input
56 - mountPath: /config-input/appc-svclogic-config
57 name: onap-appc-svclogic-config-input
58 - mountPath: /config-input/sdnc-data-properties
59 name: onap-sdnc-data-properties-input
60 - mountPath: /config-input/sdnc-svclogic-config
61 name: onap-sdnc-svclogic-config-input
62 - mountPath: /config/appc-data-properties
63 name: onap-appc-data-properties
64 - mountPath: /config/appc-svclogic-config
65 name: onap-appc-svclogic-config
66 - mountPath: /config/sdnc-data-properties
67 name: onap-sdnc-data-properties
68 - mountPath: /config/sdnc-svclogic-config
69 name: onap-sdnc-svclogic-config
70 image: "{{ .Values.global.envsubstImage }}"
71 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72 name: {{ include "common.name" . }}-update-config
73
Taka Cho31eb2452019-06-24 21:10:50 -040074 - name: {{ include "common.name" . }}-readiness
75 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020076 - /app/ready.py
Mike Elliott13fed112018-02-28 08:33:33 -050077 args:
78 - --container-name
pramod47b1b822018-08-28 15:41:45 +000079 - {{.Values.config.mariadbGaleraContName}}
Mike Elliott13fed112018-02-28 08:33:33 -050080 env:
81 - name: NAMESPACE
82 valueFrom:
83 fieldRef:
84 apiVersion: v1
85 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020086 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Mike Elliott13fed112018-02-28 08:33:33 -050087 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho31eb2452019-06-24 21:10:50 -040088 - name: {{ include "common.name" . }}-chown
89 image: "busybox"
90 command: ["sh", "-c", "chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}"]
91 volumeMounts:
92 - mountPath: {{ .Values.persistence.mdsalPath }}
93 name: {{ include "common.fullname" . }}-data
Mike Elliott13fed112018-02-28 08:33:33 -050094 containers:
95 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000096 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Mike Elliott13fed112018-02-28 08:33:33 -050097 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
98 command:
99 - /opt/appc/bin/startODL.sh
100 ports:
101 - containerPort: {{ .Values.service.internalPort }}
102 - containerPort: {{ .Values.service.externalPort2 }}
103 readinessProbe:
Taka Chocdc42662019-11-08 16:08:38 -0500104 tcpSocket:
105 port: {{ .Values.service.internalPort }}
Mike Elliott13fed112018-02-28 08:33:33 -0500106 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
107 periodSeconds: {{ .Values.readiness.periodSeconds }}
108 env:
109 - name: MYSQL_ROOT_PASSWORD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100110 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-pass" "key" "password") | indent 14}}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100111 - name: APPC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100112 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "login") | indent 14 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100113 - name: APPC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100114 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "appcdb-user-creds" "key" "password") | indent 14 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100115 - name: SDNC_DB_USER
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100116 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "login") | indent 14 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100117 - name: SDNC_DB_PASSWD
Krzysztof Opasiakde8ba182020-03-24 03:24:51 +0100118 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdncdb-user-creds" "key" "password") | indent 14 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500119 - name: SDNC_CONFIG_DIR
120 value: "{{ .Values.config.configDir }}"
121 - name: APPC_CONFIG_DIR
122 value: "{{ .Values.config.configDir }}"
123 - name: DMAAP_TOPIC_ENV
124 value: "{{ .Values.config.dmaapTopic }}"
Aaron Hay145818b2018-06-05 13:23:50 -0400125 - name: ENABLE_AAF
126 value: "{{ .Values.config.enableAAF }}"
Mike Elliott13fed112018-02-28 08:33:33 -0500127 - name: ENABLE_ODL_CLUSTER
128 value: "{{ .Values.config.enableClustering }}"
129 - name: APPC_REPLICAS
130 value: "{{ .Values.replicaCount }}"
131 volumeMounts:
132 - mountPath: /etc/localtime
133 name: localtime
134 readOnly: true
135 - mountPath: /opt/onap/appc/data/properties/dblib.properties
136 name: onap-appc-data-properties
137 subPath: dblib.properties
138 - mountPath: /opt/onap/appc/data/properties/svclogic.properties
139 name: onap-appc-data-properties
140 subPath: svclogic.properties
141 - mountPath: /opt/onap/appc/data/properties/appc.properties
142 name: onap-appc-data-properties
143 subPath: appc.properties
144 - mountPath: /opt/onap/appc/data/properties/aaiclient.properties
145 name: onap-appc-data-properties
146 subPath: aaiclient.properties
Aaron Hay3395df22018-10-30 18:31:41 -0400147 - mountPath: /opt/onap/appc/data/properties/cadi.properties
148 name: onap-appc-data-properties
149 subPath: cadi.properties
Aaron Hay145818b2018-06-05 13:23:50 -0400150 - mountPath: /opt/onap/appc/data/properties/aaa-app-config.xml
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100151 name: onap-appc-data-properties-input
Aaron Hay145818b2018-06-05 13:23:50 -0400152 subPath: aaa-app-config.xml
Taka Cho870b9432019-08-23 15:14:41 -0400153 - mountPath: /opt/onap/appc/data/properties/bath_config.csv
154 name: onap-appc-data-properties
155 subPath: bath_config.csv
Mike Elliott13fed112018-02-28 08:33:33 -0500156 - mountPath: /opt/onap/appc/svclogic/config/svclogic.properties
157 name: onap-appc-svclogic-config
158 subPath: svclogic.properties
159 - mountPath: /opt/onap/appc/svclogic/bin/showActiveGraphs.sh
160 name: onap-appc-svclogic-bin
161 subPath: showActiveGraphs.sh
162 - mountPath: /opt/onap/appc/bin/startODL.sh
163 name: onap-appc-bin
164 subPath: startODL.sh
165 - mountPath: /opt/onap/appc/bin/installAppcDb.sh
166 name: onap-appc-bin
167 subPath: installAppcDb.sh
Aaron Hay1d464b52018-05-25 14:58:32 -0400168 - mountPath: /opt/onap/appc/bin/health_check.sh
169 name: onap-appc-bin
170 subPath: health_check.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400171 - mountPath: /opt/onap/ccsdk/data/properties/dblib.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500172 name: onap-sdnc-data-properties
173 subPath: dblib.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400174 - mountPath: /opt/onap/ccsdk/data/properties/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500175 name: onap-sdnc-data-properties
176 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400177 - mountPath: /opt/onap/ccsdk/data/properties/aaiclient.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500178 name: onap-sdnc-data-properties
179 subPath: aaiclient.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400180 - mountPath: /opt/onap/ccsdk/svclogic/config/svclogic.properties
Mike Elliott13fed112018-02-28 08:33:33 -0500181 name: onap-sdnc-svclogic-config
182 subPath: svclogic.properties
Aaron Hay84e2c342018-04-17 12:37:31 -0400183 - mountPath: /opt/onap/ccsdk/svclogic/bin/showActiveGraphs.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500184 name: onap-sdnc-svclogic-bin
185 subPath: showActiveGraphs.sh
Aaron Hay84e2c342018-04-17 12:37:31 -0400186 - mountPath: /opt/onap/ccsdk/bin/installSdncDb.sh
Mike Elliott13fed112018-02-28 08:33:33 -0500187 name: onap-sdnc-bin
188 subPath: installSdncDb.sh
BorislavG3dad2f42018-04-16 10:19:45 +0000189 - mountPath: {{ .Values.persistence.mdsalPath }}
190 name: {{ include "common.fullname" . }}-data
Sylvain Desbureaux531d03f2020-04-22 10:37:45 +0200191 - mountPath: {{ .Values.log.path }}
Mike Elliott13fed112018-02-28 08:33:33 -0500192 name: logs
Taka Choe1e2e1c2019-09-17 13:42:28 -0400193 - mountPath: /opt/onap/appc/data/org.ops4j.pax.logging.cfg
Mike Elliott13fed112018-02-28 08:33:33 -0500194 name: log-config
195 subPath: org.ops4j.pax.logging.cfg
Taka Choc6559a92020-03-31 13:52:56 -0400196 - mountPath: /opt/onap/appc/data/stores/org.onap.appc.p12
197 name: p12-certs
198 subPath: org.onap.appc.p12
199 - mountPath: /opt/onap/appc/data/stores/org.onap.appc.keyfile
200 name: keyfile-certs
201 subPath: org.onap.appc.keyfile
Mike Elliott13fed112018-02-28 08:33:33 -0500202 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000203{{ include "common.resources" . | indent 12 }}
GregSulek973bfad2018-09-19 06:48:37 -0400204 {{- if .Values.nodeSelector }}
Mike Elliott13fed112018-02-28 08:33:33 -0500205 nodeSelector:
206{{ toYaml .Values.nodeSelector | indent 10 }}
207 {{- end -}}
208 {{- if .Values.affinity }}
209 affinity:
210{{ toYaml .Values.affinity | indent 10 }}
211 {{- end }}
212
213 # side car containers
Sylvain Desbureaux531d03f2020-04-22 10:37:45 +0200214 {{ include "common.log.sidecar" . | nindent 8 }}
Mike Elliott13fed112018-02-28 08:33:33 -0500215 volumes:
Taka Choc6559a92020-03-31 13:52:56 -0400216 - name: keyfile-certs
217 secret:
218 secretName: {{ include "common.fullname" . }}-certs
219 - name: p12-certs
220 secret:
221 secretName: {{ include "common.fullname" . }}-certs
Mike Elliott13fed112018-02-28 08:33:33 -0500222 - name: localtime
223 hostPath:
224 path: /etc/localtime
Mike Elliott13fed112018-02-28 08:33:33 -0500225 - name: log-config
226 configMap:
227 name: {{ include "common.fullname" . }}-logging-cfg
228 - name: logs
229 emptyDir: {}
Sylvain Desbureaux531d03f2020-04-22 10:37:45 +0200230 {{ include "common.log.volumes" . | nindent 8 }}
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100231 - name: onap-appc-data-properties-input
Mike Elliott13fed112018-02-28 08:33:33 -0500232 configMap:
233 name: {{ include "common.fullname" . }}-onap-appc-data-properties
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100234 - name: onap-appc-svclogic-config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500235 configMap:
236 name: {{ include "common.fullname" . }}-onap-appc-svclogic-config
237 - name: onap-appc-svclogic-bin
238 configMap:
239 name: {{ include "common.fullname" . }}-onap-appc-svclogic-bin
240 defaultMode: 0755
241 - name: onap-appc-bin
242 configMap:
243 name: {{ include "common.fullname" . }}-onap-appc-bin
244 defaultMode: 0755
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100245 - name: onap-sdnc-data-properties-input
Mike Elliott13fed112018-02-28 08:33:33 -0500246 configMap:
247 name: {{ include "common.fullname" . }}-onap-sdnc-data-properties
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100248 - name: onap-sdnc-svclogic-config-input
Mike Elliott13fed112018-02-28 08:33:33 -0500249 configMap:
250 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-config
251 - name: onap-sdnc-svclogic-bin
252 configMap:
253 name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-bin
254 defaultMode: 0755
255 - name: onap-sdnc-bin
256 configMap:
257 name: {{ include "common.fullname" . }}-onap-sdnc-bin
258 defaultMode: 0755
Krzysztof Opasiak967946c2020-02-19 01:44:30 +0100259 - name: onap-appc-data-properties
260 emptyDir:
261 medium: Memory
262 - name: onap-appc-svclogic-config
263 emptyDir:
264 medium: Memory
265 - name: onap-sdnc-data-properties
266 emptyDir:
267 medium: Memory
268 - name: onap-sdnc-svclogic-config
269 emptyDir:
270 medium: Memory
BorislavG8b31f6d2018-05-02 14:06:08 +0000271{{ if not .Values.persistence.enabled }}
BorislavG3dad2f42018-04-16 10:19:45 +0000272 - name: {{ include "common.fullname" . }}-data
273 emptyDir: {}
BorislavG8b31f6d2018-05-02 14:06:08 +0000274{{ else }}
BorislavG3dad2f42018-04-16 10:19:45 +0000275 volumeClaimTemplates:
276 - metadata:
277 name: {{ include "common.fullname" . }}-data
278 labels:
279 name: {{ include "common.fullname" . }}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100280 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100281 release: "{{ include "common.release" . }}"
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100282 heritage: "{{ .Release.Service }}"
BorislavG3dad2f42018-04-16 10:19:45 +0000283 spec:
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100284 accessModes:
285 - {{ .Values.persistence.accessMode }}
286 storageClassName: {{ include "common.storageClass" . }}
BorislavG3dad2f42018-04-16 10:19:45 +0000287 resources:
288 requests:
289 storage: {{ .Values.persistence.size }}
BorislavG8b31f6d2018-05-02 14:06:08 +0000290{{ end }}