blob: a8db82786345a25cf93cc97d783dc6bf8c755b0b [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
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050028 annotations:
29 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -050030 spec:
31 terminationGracePeriodSeconds: 10
32 affinity:
33 podAntiAffinity:
34 requiredDuringSchedulingIgnoredDuringExecution:
35 - labelSelector:
36 matchExpressions:
37 - key: app
38 operator: In
39 values:
40 - kafka
41 topologyKey: kubernetes.io/hostname
42 containers:
43 - name: kafka
44 image: wurstmeister/kafka:1.0.0
45 ports:
46 - containerPort: 9092
47 env:
48 - name: KAFKA_ADVERTISED_PORT
49 value: "9092"
50 - name: KAFKA_ZOOKEEPER_CONNECT
51 value: zoo1:2181,zoo2:2181,zoo3:2181
52 - name: KAFKA_HEAP_OPTS
53 value: "-Xmx256M -Xms128M"