License addition in all yamls
[oom.git] / kubernetes / dcae / templates / dcae-kafka.yaml
1 # 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.
14
15 #{{ if not .Values.disableDcaeKafka }}
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: kafka
20   namespace: "{{ .Values.nsPrefix }}"
21 spec:
22   selector:
23     matchLabels:
24       app: kafka
25   template:
26     metadata:
27       labels:
28         app: kafka
29       name: kafka
30     spec:
31       initContainers:
32       - command:
33         - /root/ready.py
34         args:
35         - --container-name
36         - zookeeper
37         env:
38         - name: NAMESPACE
39           valueFrom:
40             fieldRef:
41               apiVersion: v1
42               fieldPath: metadata.namespace
43         image: {{ .Values.image.readiness }}
44         imagePullPolicy: {{ .Values.pullPolicy }}
45         name: kafka-readiness
46       containers:
47       - image: {{ .Values.image.kafka }}
48         imagePullPolicy: {{ .Values.pullPolicy }}
49         name: kafka
50         ports:
51         - containerPort: 9092
52         readinessProbe:
53           tcpSocket:
54             port: 9092
55           initialDelaySeconds: 5
56           periodSeconds: 10
57         env:
58         - name: KAFKA_ZOOKEEPER_CONNECT
59           value: "zookeeper.{{ .Values.nsPrefix }}"
60         - name: KAFKA_ADVERTISED_HOST_NAME
61           value: "kafka"
62         - name: KAFKA_BROKER_ID
63           value: "1"
64         - name: KAFKA_ADVERTISED_PORT
65           value: "9092"
66         - name: KAFKA_PORT
67           value: "9092"
68         volumeMounts:
69         - mountPath: /var/run/docker.sock
70           name: docker-socket
71         - mountPath: /kafka
72           name: kafka-data
73         - mountPath: /start-kafka.sh
74           name: start-kafka
75       restartPolicy: Always
76       volumes:
77       - name: docker-socket
78         hostPath:
79           path: /var/run/docker.sock
80       - name: kafka-data
81         hostPath:
82           path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/
83       - name: start-kafka
84         hostPath:
85           path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh
86       imagePullSecrets:
87       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
88 #{{ end }}