-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkafka.yaml
72 lines (72 loc) · 1.3 KB
/
kafka.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
apiVersion: v1
kind: ConfigMap
metadata:
name: kafka-cm
data:
ZOOKEEPER: "zk-svc.default.svc.cluster.local:2181"
---
apiVersion: v1
kind: Service
metadata:
name: kafka-svc
labels:
app: kafka
spec:
ports:
- port: 9092
name: plaintext
clusterIP: None
selector:
app: kafka
---
apiVersion: v1
kind: Service
metadata:
name: kafka-service
labels:
app: kafka
spec:
ports:
- port: 9092
name: plaintext
selector:
app: kafka
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: kafka
spec:
selector:
matchLabels:
app: kafka
serviceName: "kafka-svc"
replicas: 3
template:
metadata:
labels:
app: kafka
spec:
terminationGracePeriodSeconds: 10
containers:
- name: kafka
image: docker.io/prakashpsgcse/kafka:2.7
imagePullPolicy: Never
ports:
- containerPort: 9092
name: plaintext
envFrom:
- configMapRef:
name: kafka-cm
volumeMounts:
- name: kafka-pvc
mountPath: /mnt/kafka
volumeClaimTemplates:
- metadata:
name: kafka-pvc
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "standard"
resources:
requests:
storage: 1Gi