Richard Jankowski | 00a0466 | 2019-02-05 12:18:53 -0500 | [diff] [blame] | 1 | # 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. |
| 14 | |
| 15 | apiVersion: v1 |
| 16 | kind: Service |
| 17 | metadata: |
| 18 | name: kafka |
| 19 | namespace: voltha |
| 20 | spec: |
| 21 | clusterIP: None |
| 22 | selector: |
| 23 | app: kafka |
| 24 | ports: |
| 25 | - protocol: TCP |
| 26 | port: 9092 |
| 27 | targetPort: 9092 |
| 28 | --- |
| 29 | apiVersion: apps/v1beta1 |
| 30 | kind: StatefulSet |
| 31 | metadata: |
| 32 | name: kafka |
| 33 | namespace: voltha |
| 34 | spec: |
| 35 | serviceName: kafka |
| 36 | replicas: 3 |
| 37 | updateStrategy: |
| 38 | type: RollingUpdate |
| 39 | selector: |
| 40 | matchLabels: |
| 41 | app: kafka |
| 42 | template: |
| 43 | metadata: |
| 44 | labels: |
| 45 | app: kafka |
| 46 | annotations: |
| 47 | cni: "calico" |
| 48 | spec: |
| 49 | terminationGracePeriodSeconds: 10 |
| 50 | affinity: |
| 51 | podAntiAffinity: |
| 52 | requiredDuringSchedulingIgnoredDuringExecution: |
| 53 | - labelSelector: |
| 54 | matchExpressions: |
| 55 | - key: app |
| 56 | operator: In |
| 57 | values: |
| 58 | - kafka |
| 59 | topologyKey: kubernetes.io/hostname |
| 60 | containers: |
| 61 | - name: kafka |
| 62 | image: wurstmeister/kafka:1.0.0 |
| 63 | ports: |
| 64 | - containerPort: 9092 |
| 65 | env: |
| 66 | - name: KAFKA_ADVERTISED_PORT |
| 67 | value: "9092" |
| 68 | - name: KAFKA_ZOOKEEPER_CONNECT |
| 69 | value: zoo1:2181,zoo2:2181,zoo3:2181 |
| 70 | - name: KAFKA_HEAP_OPTS |
| 71 | value: "-Xmx256M -Xms128M" |