blob: a55bb3a82288becafbb0a8761841ef498d4b0a65 [file] [log] [blame]
Richard Jankowski00a04662019-02-05 12:18:53 -05001# Copyright 2019-present Open Networking Foundation
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.
Richard Jankowski00a04662019-02-05 12:18:53 -050014apiVersion: v1
15kind: Service
16metadata:
17 name: kafka
18 namespace: voltha
19spec:
20 clusterIP: None
21 selector:
22 app: kafka
23 ports:
24 - protocol: TCP
25 port: 9092
26 targetPort: 9092
27---
28apiVersion: apps/v1beta1
29kind: StatefulSet
30metadata:
31 name: kafka
32 namespace: voltha
33spec:
34 serviceName: kafka
35 replicas: 3
36 updateStrategy:
37 type: RollingUpdate
38 selector:
39 matchLabels:
40 app: kafka
41 template:
42 metadata:
43 labels:
44 app: kafka
45 annotations:
46 cni: "calico"
47 spec:
48 terminationGracePeriodSeconds: 10
49 affinity:
50 podAntiAffinity:
51 requiredDuringSchedulingIgnoredDuringExecution:
52 - labelSelector:
53 matchExpressions:
54 - key: app
55 operator: In
56 values:
57 - kafka
58 topologyKey: kubernetes.io/hostname
59 containers:
60 - name: kafka
Richard Jankowski1b299922019-03-05 15:49:24 -050061 image: wurstmeister/kafka:2.11-2.0.1
Richard Jankowski00a04662019-02-05 12:18:53 -050062 ports:
63 - containerPort: 9092
64 env:
Richard Jankowski1b299922019-03-05 15:49:24 -050065 - name: KAFKA_LISTENERS
66 value: PLAINTEXT://:9092
Richard Jankowski00a04662019-02-05 12:18:53 -050067 - name: KAFKA_ZOOKEEPER_CONNECT
68 value: zoo1:2181,zoo2:2181,zoo3:2181
Richard Jankowski1b299922019-03-05 15:49:24 -050069 - name: KAFKA_AUTO_CREATE_TOPICS_ENABLE
70 value: "true"