blob: a190d0d7d21781fea2b515cd0f28d9338b01e64e [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 "+" "_" }}
22 release: {{ .Release.Name }}
23 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" . }}
31 release: {{ .Release.Name }}
32 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
econwar4d9f35f2019-04-16 08:02:13 +000048 - name: {{ include "common.name" . }}-permission-fixer
49 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
50 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51 volumeMounts:
52 - mountPath: {{ .Values.persistence.spoolPath }}
53 name: {{ include "common.fullname" . }}-spool-data-pvc
54 - mountPath: {{ .Values.persistence.eventLogsPath }}
55 name: {{ include "common.fullname" . }}-event-logs-pvc
56 command: ["chown","-Rf","1000:1001", "/opt/app/datartr"]
Fiachra Corcoranbe966552018-08-07 16:58:45 +010057 containers:
58 - name: {{ include "common.name" . }}
59 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
60 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
61 ports:
econwar28266fa2019-03-05 16:39:00 +000062 - containerPort: {{.Values.config.dmaapDrNode.externalPort}}
63 - containerPort: {{.Values.config.dmaapDrNode.externalPort2}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010064 {{- if eq .Values.liveness.enabled true }}
65 livenessProbe:
66 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +000067 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010068 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
69 periodSeconds: {{ .Values.liveness.periodSeconds }}
70 {{ end -}}
71 readinessProbe:
72 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +000073 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010074 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.readiness.periodSeconds }}
76 volumeMounts:
efiacor4808baa2019-03-11 23:36:05 +000077 - mountPath: {{ .Values.persistence.spoolPath }}
78 name: {{ include "common.fullname" . }}-spool-data-pvc
79 - mountPath: {{ .Values.persistence.eventLogsPath }}
80 name: {{ include "common.fullname" . }}-event-logs-pvc
Fiachra Corcoranbe966552018-08-07 16:58:45 +010081 - mountPath: /etc/localtime
82 name: localtime
83 readOnly: false
Fiachra Corcoranbe966552018-08-07 16:58:45 +010084 - mountPath: /opt/app/datartr/etc/node.properties
efiacoreabb6522019-04-08 09:46:09 +000085 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010086 subPath: node.properties
efiacoreabb6522019-04-08 09:46:09 +000087 - mountPath: /opt/app/datartr/etc/drNodeCadi.properties
88 name: {{ include "common.fullname" . }}-config
89 subPath: drNodeCadi.properties
efiacor7b9a0872019-08-28 21:20:22 +000090 - mountPath: /opt/app/datartr/etc/logback.xml
91 name: {{ include "common.fullname" . }}-log-conf
92 subPath: logback.xml
93 - mountPath: {{ .Values.global.loggingDirectory }}
94 name: {{ include "common.fullname" . }}-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +010095 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000096{{ include "common.resources" . | indent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010097 {{- if .Values.nodeSelector }}
98 nodeSelector:
99{{ toYaml .Values.nodeSelector | indent 10 }}
100 {{- end -}}
101 {{- if .Values.affinity }}
102 affinity:
103{{ toYaml .Values.affinity | indent 10 }}
104 {{- end }}
econwar378cf192019-01-08 16:19:59 +0000105 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +0000106 - name: {{ include "common.name" . }}-filebeat-onap
econwar378cf192019-01-08 16:19:59 +0000107 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
108 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
109 volumeMounts:
110 - name: {{ include "common.fullname" . }}-filebeat-conf
111 mountPath: /usr/share/filebeat/filebeat.yml
112 subPath: filebeat.yml
113 - name: {{ include "common.fullname" . }}-data-filebeat
114 mountPath: /usr/share/filebeat/data
efiacor7b9a0872019-08-28 21:20:22 +0000115 - name: {{ include "common.fullname" . }}-logs
econwar378cf192019-01-08 16:19:59 +0000116 mountPath: /var/log/onap/datarouter-node
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +0100117 imagePullSecrets:
118 - name: "{{ include "common.namespace" . }}-docker-registry-key"
efiacor4808baa2019-03-11 23:36:05 +0000119 volumes:
120 - name: localtime
121 hostPath:
122 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000123 - name: {{ include "common.fullname" . }}-config
efiacor4808baa2019-03-11 23:36:05 +0000124 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000125 name: {{ include "common.fullname" . }}-configmap
126 items:
127 - key: node.properties
128 path: node.properties
129 - key: drNodeCadi.properties
130 path: drNodeCadi.properties
efiacor4808baa2019-03-11 23:36:05 +0000131 - name: {{ include "common.fullname" . }}-log-conf
132 configMap:
133 name: {{ include "common.fullname" . }}-log
134 - name: {{ include "common.fullname" . }}-filebeat-conf
135 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000136 name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap
efiacor4808baa2019-03-11 23:36:05 +0000137 - name: {{ include "common.fullname" . }}-data-filebeat
138 emptyDir: {}
139 - name: {{ include "common.fullname" . }}-event-logs-pvc
140 emptyDir: {}
efiacor7b9a0872019-08-28 21:20:22 +0000141 - name: {{ include "common.fullname" . }}-logs
142 emptyDir: {}
efiacor4808baa2019-03-11 23:36:05 +0000143 volumeClaimTemplates:
144 - metadata:
145 name: {{ include "common.fullname" . }}-spool-data-pvc
146 labels:
147 name: {{ include "common.fullname" . }}
148 spec:
149 accessModes: [ {{ .Values.persistence.accessMode }} ]
150 storageClassName: {{ include "common.fullname" . }}-spool-data-stcl
151 resources:
152 requests:
153 storage: {{ .Values.persistence.spoolSize }}
154 selector:
155 matchLabels:
156 name: {{ include "common.fullname" . }}-spool-data-pv
157 - metadata:
158 name: {{ include "common.fullname" . }}-event-logs-pvc
159 labels:
160 name: {{ include "common.fullname" . }}
161 spec:
162 accessModes: [ {{ .Values.persistence.accessMode }} ]
163 storageClassName: {{ include "common.fullname" . }}-event-logs-stcl
164 resources:
165 requests:
166 storage: {{ .Values.persistence.eventLogSize }}
167 selector:
168 matchLabels:
169 name: {{ include "common.fullname" . }}-event-logs-pv