blob: 059d180c77fa304251329d6cbc68ae118546501c [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001# Copyright 2017-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.
Richard Jankowskie5858082018-01-15 18:25:38 -050014apiVersion: v1
15kind: Service
16metadata:
17 name: kafka
Richard Jankowskid4454382018-02-08 16:21:43 -050018 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050019spec:
20 clusterIP: None
21 selector:
22 app: kafka
23 ports:
24 - protocol: TCP
25 port: 9092
26 targetPort: 9092
27---
28apiVersion: apps/v1beta1
29kind: StatefulSet
30metadata:
31 name: kafka
Richard Jankowskid4454382018-02-08 16:21:43 -050032 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050033spec:
34 serviceName: kafka
35 replicas: 3
Stephane Barbariebcea2f42018-03-02 18:46:32 -050036 updateStrategy:
37 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -050038 selector:
39 matchLabels:
40 app: kafka
41 template:
42 metadata:
43 labels:
44 app: kafka
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050045 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -040046 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -050047 spec:
48 terminationGracePeriodSeconds: 10
49 affinity:
50 podAntiAffinity:
51 requiredDuringSchedulingIgnoredDuringExecution:
52 - labelSelector:
53 matchExpressions:
54 - key: app
55 operator: In
56 values:
57 - kafka
58 topologyKey: kubernetes.io/hostname
59 containers:
60 - name: kafka
61 image: wurstmeister/kafka:1.0.0
62 ports:
63 - containerPort: 9092
64 env:
65 - name: KAFKA_ADVERTISED_PORT
66 value: "9092"
67 - name: KAFKA_ZOOKEEPER_CONNECT
68 value: zoo1:2181,zoo2:2181,zoo3:2181
69 - name: KAFKA_HEAP_OPTS
70 value: "-Xmx256M -Xms128M"