blob: 2c4b0de63b782a3845a5be7d058a81850f380ca6 [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
48 containers:
49 - name: {{ include "common.name" . }}
50 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 ports:
econwar28266fa2019-03-05 16:39:00 +000053 - containerPort: {{.Values.config.dmaapDrNode.externalPort}}
54 - containerPort: {{.Values.config.dmaapDrNode.externalPort2}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010055 {{- if eq .Values.liveness.enabled true }}
56 livenessProbe:
57 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +000058 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010059 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.liveness.periodSeconds }}
61 {{ end -}}
62 readinessProbe:
63 tcpSocket:
econwar28266fa2019-03-05 16:39:00 +000064 port: {{.Values.config.dmaapDrNode.internalPort}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010065 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.readiness.periodSeconds }}
67 volumeMounts:
efiacor4808baa2019-03-11 23:36:05 +000068 - mountPath: {{ .Values.persistence.spoolPath }}
69 name: {{ include "common.fullname" . }}-spool-data-pvc
70 - mountPath: {{ .Values.persistence.eventLogsPath }}
71 name: {{ include "common.fullname" . }}-event-logs-pvc
Fiachra Corcoranbe966552018-08-07 16:58:45 +010072 - mountPath: /etc/localtime
73 name: localtime
74 readOnly: false
75 - mountPath: /opt/app/datartr/etc/dedicatedFeed.json
76 subPath: dedicatedFeed.json
77 name: create-feed
78 - mountPath: /opt/app/datartr/etc/createFeed.sh
79 subPath: createFeed.sh
80 name: create-feed
81 - mountPath: /opt/app/datartr/etc/node.properties
82 subPath: node.properties
83 name: node-props
84 lifecycle:
85 postStart:
86 exec:
87 command:
efiacor4808baa2019-03-11 23:36:05 +000088 - /opt/app/datartr/etc/createFeed.sh
Fiachra Corcoranbe966552018-08-07 16:58:45 +010089 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000090{{ include "common.resources" . | indent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010091 {{- if .Values.nodeSelector }}
92 nodeSelector:
93{{ toYaml .Values.nodeSelector | indent 10 }}
94 {{- end -}}
95 {{- if .Values.affinity }}
96 affinity:
97{{ toYaml .Values.affinity | indent 10 }}
98 {{- end }}
econwar378cf192019-01-08 16:19:59 +000099 # Filebeat sidecar container
100 - name: {{ include "common.name" . }}-filebeat-onap
101 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
102 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
103 volumeMounts:
104 - name: {{ include "common.fullname" . }}-filebeat-conf
105 mountPath: /usr/share/filebeat/filebeat.yml
106 subPath: filebeat.yml
107 - name: {{ include "common.fullname" . }}-data-filebeat
108 mountPath: /usr/share/filebeat/data
efiacor4808baa2019-03-11 23:36:05 +0000109 - name: {{ include "common.fullname" . }}-event-logs-pvc
econwar378cf192019-01-08 16:19:59 +0000110 mountPath: /var/log/onap/datarouter-node
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +0100111 imagePullSecrets:
112 - name: "{{ include "common.namespace" . }}-docker-registry-key"
efiacor4808baa2019-03-11 23:36:05 +0000113 volumes:
114 - name: localtime
115 hostPath:
116 path: /etc/localtime
117 - name: create-feed
118 configMap:
119 name: {{ include "common.fullname" . }}-create-feed-configmap
120 defaultMode: 0755
121 - name: node-props
122 configMap:
123 name: {{ include "common.fullname" . }}-node-props-configmap
124 - name: {{ include "common.fullname" . }}-log-conf
125 configMap:
126 name: {{ include "common.fullname" . }}-log
127 - name: {{ include "common.fullname" . }}-filebeat-conf
128 configMap:
129 name: {{ .Release.Name }}-dmaap-filebeat-configmap
130 - name: {{ include "common.fullname" . }}-data-filebeat
131 emptyDir: {}
132 - name: {{ include "common.fullname" . }}-event-logs-pvc
133 emptyDir: {}
134 volumeClaimTemplates:
135 - metadata:
136 name: {{ include "common.fullname" . }}-spool-data-pvc
137 labels:
138 name: {{ include "common.fullname" . }}
139 spec:
140 accessModes: [ {{ .Values.persistence.accessMode }} ]
141 storageClassName: {{ include "common.fullname" . }}-spool-data-stcl
142 resources:
143 requests:
144 storage: {{ .Values.persistence.spoolSize }}
145 selector:
146 matchLabels:
147 name: {{ include "common.fullname" . }}-spool-data-pv
148 - metadata:
149 name: {{ include "common.fullname" . }}-event-logs-pvc
150 labels:
151 name: {{ include "common.fullname" . }}
152 spec:
153 accessModes: [ {{ .Values.persistence.accessMode }} ]
154 storageClassName: {{ include "common.fullname" . }}-event-logs-stcl
155 resources:
156 requests:
157 storage: {{ .Values.persistence.eventLogSize }}
158 selector:
159 matchLabels:
160 name: {{ include "common.fullname" . }}-event-logs-pv