blob: 00f8441e29a4f04012607dc389718cfc1211ec0f [file] [log] [blame]
Richard Jankowskie5858082018-01-15 18:25:38 -05001apiVersion: v1
2kind: Service
3metadata:
4 name: kafka
Richard Jankowskid4454382018-02-08 16:21:43 -05005 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -05006spec:
7 clusterIP: None
8 selector:
9 app: kafka
10 ports:
11 - protocol: TCP
12 port: 9092
13 targetPort: 9092
14---
15apiVersion: apps/v1beta1
16kind: StatefulSet
17metadata:
18 name: kafka
Richard Jankowskid4454382018-02-08 16:21:43 -050019 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050020spec:
21 serviceName: kafka
22 replicas: 3
23 selector:
24 matchLabels:
25 app: kafka
26 template:
27 metadata:
28 labels:
29 app: kafka
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050030 annotations:
31 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -050032 spec:
33 terminationGracePeriodSeconds: 10
34 affinity:
35 podAntiAffinity:
36 requiredDuringSchedulingIgnoredDuringExecution:
37 - labelSelector:
38 matchExpressions:
39 - key: app
40 operator: In
41 values:
42 - kafka
43 topologyKey: kubernetes.io/hostname
44 containers:
45 - name: kafka
46 image: wurstmeister/kafka:1.0.0
47 ports:
48 - containerPort: 9092
49 env:
50 - name: KAFKA_ADVERTISED_PORT
51 value: "9092"
52 - name: KAFKA_ZOOKEEPER_CONNECT
53 value: zoo1:2181,zoo2:2181,zoo3:2181
54 - name: KAFKA_HEAP_OPTS
55 value: "-Xmx256M -Xms128M"