Richard Jankowski | e585808 | 2018-01-15 18:25:38 -0500 | [diff] [blame] | 1 | apiVersion: v1 |
| 2 | kind: Service |
| 3 | metadata: |
| 4 | name: kafka |
| 5 | spec: |
| 6 | clusterIP: None |
| 7 | selector: |
| 8 | app: kafka |
| 9 | ports: |
| 10 | - protocol: TCP |
| 11 | port: 9092 |
| 12 | targetPort: 9092 |
| 13 | --- |
| 14 | apiVersion: apps/v1beta1 |
| 15 | kind: StatefulSet |
| 16 | metadata: |
| 17 | name: kafka |
| 18 | spec: |
| 19 | serviceName: kafka |
| 20 | replicas: 3 |
| 21 | selector: |
| 22 | matchLabels: |
| 23 | app: kafka |
| 24 | template: |
| 25 | metadata: |
| 26 | labels: |
| 27 | app: kafka |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 28 | annotations: |
| 29 | cni: "weave" |
Richard Jankowski | e585808 | 2018-01-15 18:25:38 -0500 | [diff] [blame] | 30 | 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" |