Merge "[DOC] Update Kubernetes RKE installation doc"
[oom.git] / kubernetes / dmaap / components / message-router / templates / statefulset.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T
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       initContainers:
27       - command:
28         - /root/ready.py
29         args:
30         - --container-name
31         - {{ .Values.kafka.name }}
32         - --container-name
33         - {{ .Values.zookeeper.name }}
34         env:
35         - name: NAMESPACE
36           valueFrom:
37             fieldRef:
38               apiVersion: v1
39               fieldPath: metadata.namespace
40         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
41         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42         name: {{ include "common.name" . }}-readiness
43       containers:
44         - name: {{ include "common.name" . }}
45           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
46           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47           ports: {{ include "common.containerPorts" . | nindent 10  }}
48           {{- if eq .Values.liveness.enabled true }}
49           livenessProbe:
50             tcpSocket:
51               port: {{ .Values.liveness.port }}
52             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53             periodSeconds: {{ .Values.liveness.periodSeconds }}
54             timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
55           {{ end -}}
56           readinessProbe:
57             tcpSocket:
58               port: {{ .Values.readiness.port }}
59             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.readiness.periodSeconds }}
61             timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
62           env:
63           - name: enableCadi
64             value: "{{ .Values.global.aafEnabled }}"
65           volumeMounts:
66           - mountPath: /etc/localtime
67             name: localtime
68             readOnly: true
69           - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
70             subPath: MsgRtrApi.properties
71             name: appprops
72           - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml
73             subPath: logback.xml
74             name: logback
75           - mountPath: /appl/dmaapMR1/etc/cadi.properties
76             subPath: cadi.properties
77             name: cadi
78           - mountPath: /appl/dmaapMR1/etc/keyfile
79             subPath: mykey
80             name: mykey
81           resources: {{ include "common.resources" . | nindent 12 }}
82       volumes:
83         - name: localtime
84           hostPath:
85             path: /etc/localtime
86         - name: appprops
87           configMap:
88             name: {{ include "common.fullname" . }}-msgrtrapi-prop-configmap
89         - name: logback
90           configMap:
91             name: {{ include "common.fullname" . }}-logback-xml-configmap
92         - name: cadi
93           configMap:
94             name: {{ include "common.fullname" . }}-cadi-prop-configmap
95         - name: mykey
96           secret:
97             secretName: {{ include "common.fullname" . }}-secret
98       imagePullSecrets:
99       - name: "{{ include "common.namespace" . }}-docker-registry-key"