Kafka image changes
[oom.git] / kubernetes / dmaap / charts / message-router / charts / message-router-kafka / 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: extensions/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   replicas: {{ .Values.replicaCount }}
28   template:
29     metadata:
30       labels:
31         app:  {{ include "common.name" . }}
32         release: {{ .Release.Name }}
33     spec:
34       initContainers:
35       - name: {{ include "common.name" . }}-seed-kafka-topics
36         command:
37         - /bin/bash
38         - -c
39         - >
40           if [ -d /tmp/topics/ECOMP-PORTAL-INBOX-0 ]; then
41           echo "nothing to do";
42           else
43           git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
44           echo "Clone complete. Copying from /tmp/gerrit/oom-projects/data-kafka/kafka-logs/* to /tmp/topics";
45           cp -var /tmp/gerrit/oom-topics/data-kafka/kafka-logs/* /tmp/topics;
46           echo "Done.";
47           fi
48         image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
49         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50         volumeMounts:
51         - mountPath: /tmp/topics
52           name: kafka-data
53       - command:
54         - /root/ready.py
55         args:
56         - --container-name
57         - {{ .Values.zookeeper.name }}
58         env:
59         - name: NAMESPACE
60           valueFrom:
61             fieldRef:
62               apiVersion: v1
63               fieldPath: metadata.namespace
64         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
65         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66         name: {{ include "common.name" . }}-readiness
67       containers:
68       - name: {{ include "common.name" .  }}
69         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
70         imagePullPolicy:  {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71         ports:
72         - containerPort: {{ .Values.service.internalPort }}
73         {{ if eq .Values.liveness.enabled true }}
74         livenessProbe:
75           tcpSocket:
76             port: {{ .Values.service.internalPort }}
77           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
78           periodSeconds: {{ .Values.liveness.periodSeconds }}
79         {{ end }}
80         readinessProbe:
81           tcpSocket:
82             port: {{ .Values.service.internalPort }}
83           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
84           periodSeconds: {{ .Values.readiness.periodSeconds }}
85         env:
86         - name: KAFKA_ZOOKEEPER_CONNECT
87           value: "{{.Values.zookeeper.name}}:{{.Values.zookeeper.port}}"
88         - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
89           value: "INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT"
90         - name: KAFKA_ADVERTISED_LISTENERS
91           value: "INTERNAL_PLAINTEXT://{{ include "common.servicename" .  }}:{{.Values.service.internalPort}}"
92         - name: KAFKA_LISTENERS
93           value: "INTERNAL_PLAINTEXT://0.0.0.0:{{.Values.service.internalPort}}"
94         - name: KAFKA_INTER_BROKER_LISTENER_NAME
95           value: "INTERNAL_PLAINTEXT"
96         volumeMounts:
97         - mountPath: /etc/localtime
98           name: localtime
99           readOnly: true
100         - mountPath: /var/run/docker.sock
101           name: docker-socket
102         - mountPath: /kafka
103           name: kafka-data
104       volumes:
105       - name: localtime
106         hostPath:
107           path: /etc/localtime
108       - name: docker-socket
109         hostPath:
110           path: /var/run/docker.sock
111       - name: kafka-data
112         persistentVolumeClaim:
113           claimName: {{ include "common.fullname" . }}
114       imagePullSecrets:
115       - name: "{{ include "common.namespace" . }}-docker-registry-key"