DMAAP changes
[oom.git] / kubernetes / dmaap / components / message-router / charts / message-router-mirrormaker / templates / deployment.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/v1beta1
17 kind: Deployment
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ .Release.Name }}
25     heritage: {{ .Release.Service }}
26 spec:
27   serviceName: {{ .Values.service.name }}
28   replicas: {{ .Values.replicaCount }}
29   template:
30     metadata:
31       labels:
32         app:  {{ include "common.name" . }}
33         release: {{ .Release.Name }}
34     spec:
35       initContainers:
36       - name: {{ include "common.name" . }}-initcontainer
37         image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
38         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39       - command:
40         - /root/ready.py
41         args:
42         - --container-name
43         - {{ .Values.messagerouter.container }}
44         env:
45         - name: NAMESPACE
46           valueFrom:
47             fieldRef:
48               apiVersion: v1
49               fieldPath: metadata.namespace
50         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52         name: {{ include "common.name" . }}-readiness
53       containers:
54       - name: {{ include "common.name" .  }}
55         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
56         imagePullPolicy:  {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57         command:
58         - sh
59         - -exc
60         - |
61           exec start-mirrormaker.sh
62         resources:
63 {{ include "common.resources" . | indent 12 }}
64         ports:
65         - containerPort: {{ .Values.service.internalPort }}
66         {{ if eq .Values.liveness.enabled true }}
67         livenessProbe:
68           exec:
69             command:
70             - sh
71             - -c
72             - "touch /tmp/lprobe.txt"
73             - "rm /tmp/lprobe.txt"
74           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75           periodSeconds: {{ .Values.liveness.periodSeconds }}
76         {{ end }}
77         readinessProbe:
78           exec:
79             command:
80             - sh
81             - -c
82             - "touch /tmp/rprobe.txt"
83             - "rm /tmp/rprobe.txt"
84           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
85           periodSeconds: {{ .Values.readiness.periodSeconds }}
86         env:
87         - name: KAFKA_HEAP_OPTS
88           value: "{{ .Values.kafkaHeapOptions }}"
89         volumeMounts:
90         - mountPath: /etc/localtime
91           name: localtime
92           readOnly: true
93         - mountPath: /var/run/docker.sock
94           name: docker-socket
95       volumes:
96       - name: localtime
97         hostPath:
98           path: /etc/localtime
99       - name: docker-socket
100         hostPath:
101           path: /var/run/docker.sock
102       imagePullSecrets:
103       - name: "{{ include "common.namespace" . }}-docker-registry-key"