-
Notifications
You must be signed in to change notification settings - Fork 0
/
kafka-setup.yaml
56 lines (56 loc) · 1.27 KB
/
kafka-setup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
apiVersion: v1
kind: Service
metadata:
name: kafka-service
spec:
selector:
app: kafka
ports:
- protocol: TCP
name: kafka-producer
port: 9092
targetPort: 9092
- protocol: TCP
name: kafka-consumer
port: 29092
targetPort: 29092
---
# YOUR CODE HERE
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-deployment
labels:
app: kafka
spec:
selector:
matchLabels:
app: kafka
replicas: 1
template:
metadata:
labels:
app: kafka
spec:
containers:
- name: kafka
image: confluentinc/cp-kafka:7.3.3
ports:
- containerPort: 9092
env:
- name: KAFKA_BROKER_ID
value: "1"
- name: KAFKA_ZOOKEEPER_CONNECT
value: "zookeeper-service:2181"
- name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
value: "PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT"
- name: KAFKA_ADVERTISED_LISTENERS
value: "PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://kafka-service:29092"
- name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
value: "1"
- name: KAFKA_AUTO_CREATE_TOPICS_ENABLE
value: "true"
resources:
limits:
memory: "1000Mi"
cpu: "1000m"