[DMAAP] Remove AAF dependency
[oom.git] / kubernetes / dmaap / components / dmaap-dr-node / templates / statefulset.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
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.
15 */}}
16 apiVersion: apps/v1
17 kind: StatefulSet
18 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19 spec:
20   selector: {{- include "common.selectors" . | nindent 4 }}
21   serviceName: {{ include "common.servicename" . }}
22   replicas: {{ .Values.replicaCount }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       {{ include "common.podSecurityContext" . | indent 6 | trim}}
27       initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 8 }}
28         - name: {{ include "common.name" . }}-permission-fixer
29           securityContext:
30             runAsUser: 0
31           image: {{ include "repositoryGenerator.image.busybox" . }}
32           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33           command: ["chown","-Rf","1000:1001", "/opt/app/"]
34           volumeMounts:
35             - name: {{ include "common.fullname" . }}-spool
36               mountPath: {{ .Values.persistence.spool.path }}
37             - name: {{ include "common.fullname" . }}-event-logs
38               mountPath: {{ .Values.persistence.event.path }}
39       containers:
40         - name: {{ include "common.name" . }}
41           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
42           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43           ports: {{ include "common.containerPorts" . | nindent 12  }}
44           {{- if eq .Values.liveness.enabled true }}
45           livenessProbe:
46             tcpSocket:
47               port: {{.Values.liveness.port}}
48             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
49             periodSeconds: {{ .Values.liveness.periodSeconds }}
50           {{ end -}}
51           readinessProbe:
52             tcpSocket:
53               port: {{.Values.readiness.port}}
54             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
55             periodSeconds: {{ .Values.readiness.periodSeconds }}
56           volumeMounts:
57             - mountPath: {{ .Values.persistence.spool.path }}
58               name: {{ include "common.fullname" . }}-spool
59             - mountPath: {{ .Values.persistence.event.path }}
60               name: {{ include "common.fullname" . }}-event-logs
61             - mountPath: /etc/localtime
62               name: localtime
63               readOnly: false
64             - mountPath: /opt/app/datartr/etc/node.properties
65               name: {{ include "common.fullname" . }}-config
66               subPath: node.properties
67             - mountPath: /opt/app/datartr/etc/logback.xml
68               name: {{ include "common.fullname" . }}-log-conf
69               subPath: logback.xml
70           resources:
71 {{ include "common.resources" . }}
72         {{- if .Values.nodeSelector }}
73         nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
74         {{- end -}}
75         {{- if .Values.affinity }}
76         affinity: {{ toYaml .Values.affinity | nindent 10 }}
77         {{- end }}
78       imagePullSecrets:
79       - name: "{{ include "common.namespace" . }}-docker-registry-key"
80       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
81       volumes:
82         - name: localtime
83           hostPath:
84             path: /etc/localtime
85         - name: {{ include "common.fullname" . }}-config
86           configMap:
87             name: {{ include "common.fullname" . }}-node-props
88             items:
89             - key: node.properties
90               path: node.properties
91         - name: {{ include "common.fullname" . }}-log-conf
92           configMap:
93             name: {{ include "common.fullname" . }}-log
94       {{- if not .Values.persistence.enabled }}
95         - name:  {{ include "common.fullname" . }}-event-logs
96           emptyDir: {}
97         - name: {{ include "common.fullname" . }}-spool
98           emptyDir: {}
99       {{- end }}
100 {{- if .Values.persistence.enabled }}
101   volumeClaimTemplates:
102   - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }}
103   - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }}
104 {{- end }}