blob: 84f48cbf7ddf8e3bc068af1707cf63d88ea6cd45 [file] [log] [blame]
Richard Jankowskie5858082018-01-15 18:25:38 -05001apiVersion: v1
2kind: Service
3metadata:
4 name: kafka
5spec:
6 clusterIP: None
7 selector:
8 app: kafka
9 ports:
10 - protocol: TCP
11 port: 9092
12 targetPort: 9092
13---
14apiVersion: apps/v1beta1
15kind: StatefulSet
16metadata:
17 name: kafka
18spec:
19 serviceName: kafka
20 replicas: 3
21 selector:
22 matchLabels:
23 app: kafka
24 template:
25 metadata:
26 labels:
27 app: kafka
28 spec:
29 terminationGracePeriodSeconds: 10
30 affinity:
31 podAntiAffinity:
32 requiredDuringSchedulingIgnoredDuringExecution:
33 - labelSelector:
34 matchExpressions:
35 - key: app
36 operator: In
37 values:
38 - kafka
39 topologyKey: kubernetes.io/hostname
40 containers:
41 - name: kafka
42 image: wurstmeister/kafka:1.0.0
43 ports:
44 - containerPort: 9092
45 env:
46 - name: KAFKA_ADVERTISED_PORT
47 value: "9092"
48 - name: KAFKA_ZOOKEEPER_CONNECT
49 value: zoo1:2181,zoo2:2181,zoo3:2181
50 - name: KAFKA_HEAP_OPTS
51 value: "-Xmx256M -Xms128M"