blob: 4cd2ab56b5c7eeed348116ee9cd5632b37056b12 [file] [log] [blame]
Fiachra Corcoranbe966552018-08-07 16:58:45 +01001# 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.
efiacor4808baa2019-03-11 23:36:05 +000014apiVersion: apps/v1beta1
15kind: StatefulSet
Fiachra Corcoranbe966552018-08-07 16:58:45 +010016metadata:
17 name: {{ include "common.fullname" . }}
18 namespace: {{ include "common.namespace" . }}
19 labels:
20 app: {{ include "common.name" . }}
21 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010022 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010023 heritage: {{ .Release.Service }}
24spec:
25 replicas: {{ .Values.replicaCount }}
efiacor4808baa2019-03-11 23:36:05 +000026 serviceName: {{ .Values.config.dmaapDrNode.name }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010027 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010031 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010032 spec:
Fiachra Corcoranbe966552018-08-07 16:58:45 +010033 initContainers:
34 - name: {{ include "common.name" . }}-readiness
35 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37 command:
38 - /root/ready.py
39 args:
40 - --container-name
econwar28266fa2019-03-05 16:39:00 +000041 - dmaap-dr-prov
Fiachra Corcoranbe966552018-08-07 16:58:45 +010042 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
efiacore62958b2019-09-27 16:54:36 +010048 {{- if .Values.global.aafEnabled }}
efiacor0ccdd6c2020-02-05 20:42:47 +000049 - name: {{ include "common.name" . }}-aaf-readiness
50 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 command:
53 - /root/ready.py
54 args:
55 - --container-name
56 - aaf-locate
57 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
efiacore62958b2019-09-27 16:54:36 +010063 - name: {{ include "common.name" . }}-dr-node-aaf-config
64 image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}"
65 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 volumeMounts:
67 - mountPath: {{ .Values.persistence.aafCredsPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010068 name: {{ include "common.fullname" . }}-aaf-props
efiacore62958b2019-09-27 16:54:36 +010069 command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
70 env:
71 - name: APP_FQI
72 value: "{{ .Values.aafConfig.fqi }}"
73 - name: aaf_locate_url
74 value: "https://aaf-locate.{{ .Release.Namespace }}:8095"
75 - name: aaf_locator_container
76 value: "{{ .Values.global.aafLocatorContainer }}"
77 - name: aaf_locator_container_ns
78 value: "{{ .Release.Namespace }}"
79 - name: aaf_locator_fqdn
80 value: "{{ .Values.aafConfig.fqdn }}"
81 - name: aaf_locator_public_fqdn
82 value: "{{.Values.aafConfig.publicFqdn}}"
83 - name: aaf_locator_app_ns
84 value: "{{ .Values.global.aafAppNs }}"
85 - name: DEPLOY_FQI
86 value: "{{ .Values.aafConfig.aafDeployFqi }}"
87 - name: DEPLOY_PASSWORD
88 value: "{{ .Values.aafConfig.aafDeployPass }}"
89 - name: cadi_longitude
90 value: "{{ .Values.aafConfig.cadiLongitude }}"
91 - name: cadi_latitude
92 value: "{{ .Values.aafConfig.cadiLatitude }}"
93 {{- end }}
econwar4d9f35f2019-04-16 08:02:13 +000094 - name: {{ include "common.name" . }}-permission-fixer
95 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
96 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
97 volumeMounts:
98 - mountPath: {{ .Values.persistence.spoolPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010099 name: {{ include "common.fullname" . }}-data
econwar4d9f35f2019-04-16 08:02:13 +0000100 - mountPath: {{ .Values.persistence.eventLogsPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100101 name: {{ include "common.fullname" . }}-event-logs
efiacore62958b2019-09-27 16:54:36 +0100102 {{- if .Values.global.aafEnabled }}
103 - mountPath: {{ .Values.persistence.aafCredsPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100104 name: {{ include "common.fullname" . }}-aaf-props
efiacore62958b2019-09-27 16:54:36 +0100105 {{- end }}
106 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100107 containers:
108 - name: {{ include "common.name" . }}
109 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
110 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 ports:
econwar28266fa2019-03-05 16:39:00 +0000112 - containerPort: {{.Values.config.dmaapDrNode.externalPort}}
113 - containerPort: {{.Values.config.dmaapDrNode.externalPort2}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100114 {{- if eq .Values.liveness.enabled true }}
115 livenessProbe:
116 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +0000117 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100118 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
119 periodSeconds: {{ .Values.liveness.periodSeconds }}
120 {{ end -}}
121 readinessProbe:
122 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +0000123 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100124 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
125 periodSeconds: {{ .Values.readiness.periodSeconds }}
126 volumeMounts:
efiacore62958b2019-09-27 16:54:36 +0100127 {{- if .Values.global.aafEnabled }}
128 - mountPath: {{ .Values.persistence.aafCredsPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100129 name: {{ include "common.fullname" . }}-aaf-props
efiacore62958b2019-09-27 16:54:36 +0100130 {{- end }}
efiacor4808baa2019-03-11 23:36:05 +0000131 - mountPath: {{ .Values.persistence.spoolPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100132 name: {{ include "common.fullname" . }}-data
efiacor4808baa2019-03-11 23:36:05 +0000133 - mountPath: {{ .Values.persistence.eventLogsPath }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100134 name: {{ include "common.fullname" . }}-event-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100135 - mountPath: /etc/localtime
136 name: localtime
137 readOnly: false
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100138 - mountPath: /opt/app/datartr/etc/node.properties
efiacoreabb6522019-04-08 09:46:09 +0000139 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100140 subPath: node.properties
efiacor7b9a0872019-08-28 21:20:22 +0000141 - mountPath: /opt/app/datartr/etc/logback.xml
142 name: {{ include "common.fullname" . }}-log-conf
143 subPath: logback.xml
144 - mountPath: {{ .Values.global.loggingDirectory }}
145 name: {{ include "common.fullname" . }}-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100146 resources:
efiacore62958b2019-09-27 16:54:36 +0100147{{ include "common.resources" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100148 {{- if .Values.nodeSelector }}
149 nodeSelector:
150{{ toYaml .Values.nodeSelector | indent 10 }}
151 {{- end -}}
152 {{- if .Values.affinity }}
153 affinity:
154{{ toYaml .Values.affinity | indent 10 }}
efiacore62958b2019-09-27 16:54:36 +0100155 {{- end -}}
Krzysztof Opasiak03b10092020-01-24 22:45:16 +0100156 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +0000157 - name: {{ include "common.name" . }}-filebeat-onap
econwar378cf192019-01-08 16:19:59 +0000158 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
159 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
160 volumeMounts:
161 - name: {{ include "common.fullname" . }}-filebeat-conf
162 mountPath: /usr/share/filebeat/filebeat.yml
163 subPath: filebeat.yml
164 - name: {{ include "common.fullname" . }}-data-filebeat
165 mountPath: /usr/share/filebeat/data
efiacor7b9a0872019-08-28 21:20:22 +0000166 - name: {{ include "common.fullname" . }}-logs
econwar378cf192019-01-08 16:19:59 +0000167 mountPath: /var/log/onap/datarouter-node
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +0100168 imagePullSecrets:
169 - name: "{{ include "common.namespace" . }}-docker-registry-key"
efiacor4808baa2019-03-11 23:36:05 +0000170 volumes:
171 - name: localtime
172 hostPath:
173 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000174 - name: {{ include "common.fullname" . }}-config
efiacor4808baa2019-03-11 23:36:05 +0000175 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000176 name: {{ include "common.fullname" . }}-configmap
177 items:
178 - key: node.properties
179 path: node.properties
efiacor4808baa2019-03-11 23:36:05 +0000180 - name: {{ include "common.fullname" . }}-log-conf
181 configMap:
182 name: {{ include "common.fullname" . }}-log
183 - name: {{ include "common.fullname" . }}-filebeat-conf
184 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000185 name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap
efiacor4808baa2019-03-11 23:36:05 +0000186 - name: {{ include "common.fullname" . }}-data-filebeat
187 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100188 - name: {{ include "common.fullname" . }}-logs
189 emptyDir: {}
190 {{- if not .Values.persistence.enabled }}
mprzybyse1ea50d2020-01-31 10:09:02 +0000191 - name: {{ include "common.fullname" . }}-event-logs
efiacor4808baa2019-03-11 23:36:05 +0000192 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100193 - name: {{ include "common.fullname" . }}-data
efiacor7b9a0872019-08-28 21:20:22 +0000194 emptyDir: {}
efiacore62958b2019-09-27 16:54:36 +0100195 {{- if .Values.global.aafEnabled }}
mprzybyse1ea50d2020-01-31 10:09:02 +0000196 - name: {{ include "common.fullname" . }}-aaf-props
efiacore62958b2019-09-27 16:54:36 +0100197 emptyDir: {}
198 {{- end }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100199 {{- end }}
200{{- if .Values.persistence.enabled }}
efiacor4808baa2019-03-11 23:36:05 +0000201 volumeClaimTemplates:
202 - metadata:
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100203 name: {{ include "common.fullname" . }}-data
efiacor4808baa2019-03-11 23:36:05 +0000204 labels:
205 name: {{ include "common.fullname" . }}
206 spec:
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100207 accessModes:
208 - {{ .Values.persistence.accessMode }}
209 storageClassName: {{ include "common.storageClass" . }}
efiacor4808baa2019-03-11 23:36:05 +0000210 resources:
211 requests:
212 storage: {{ .Values.persistence.spoolSize }}
efiacor4808baa2019-03-11 23:36:05 +0000213 - metadata:
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100214 name: {{ include "common.fullname" . }}-event-logs
efiacor4808baa2019-03-11 23:36:05 +0000215 labels:
216 name: {{ include "common.fullname" . }}
217 spec:
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100218 accessModes:
219 - {{ .Values.persistence.accessMode }}
220 {{- if eq "True" (include "common.needPV" .) }}
221 storageClassName: "{{ include "common.fullname" . }}-data-event-logs"
222 {{- else }}
223 storageClassName: {{ include "common.storageClass" . }}
224 {{- end }}
efiacor4808baa2019-03-11 23:36:05 +0000225 resources:
226 requests:
227 storage: {{ .Values.persistence.eventLogSize }}
efiacore62958b2019-09-27 16:54:36 +0100228{{- if .Values.global.aafEnabled }}
229 - metadata:
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100230 name: {{ include "common.fullname" . }}-aaf-props
efiacore62958b2019-09-27 16:54:36 +0100231 labels:
232 name: {{ include "common.fullname" . }}
233 spec:
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100234 accessModes:
235 - {{ .Values.persistence.accessMode }}
236 {{- if eq "True" (include "common.needPV" .) }}
237 storageClassName: "{{ include "common.fullname" . }}-data-aaf-props"
238 {{- else }}
239 storageClassName: {{ include "common.storageClass" . }}
240 {{- end }}
efiacore62958b2019-09-27 16:54:36 +0100241 resources:
242 requests:
243 storage: {{ .Values.persistence.aafCredsSize }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100244{{- end }}
efiacore62958b2019-09-27 16:54:36 +0100245{{- end }}