-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsumer.yaml
79 lines (72 loc) · 1.88 KB
/
consumer.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: Secret
metadata:
name: kafka-client-config
namespace: con
type: Opaque
data:
kafka-ssl.properties: Ym9vdHN0cmFwLnNlcnZlcnM9a2Fma2EuY29uLnN2Yy5jbHVzdGVyLmxvY2FsOjkwNzEKc2VjdXJpdHkucHJvdG9jb2w9U1NMCnNzbC50cnVzdHN0b3JlLmxvY2F0aW9uPS9tbnQvc3NsY2VydHMvdHJ1c3RzdG9yZS5qa3MKc3NsLnRydXN0c3RvcmUucGFzc3dvcmQ9bXlzdG9yZXBhc3N3b3JkCnNzbC5rZXlzdG9yZS5sb2NhdGlvbj0vbW50L3NzbGNlcnRzL2tleXN0b3JlLmprcwpzc2wua2V5c3RvcmUucGFzc3dvcmQ9bXlzdG9yZXBhc3N3b3Jk
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: consumer
namespace: con
spec:
serviceName: elastic
podManagementPolicy: Parallel
replicas: 1
selector:
matchLabels:
app: elastic
template:
metadata:
labels:
app: elastic
spec:
containers:
- name: elastic
image: confluentinc/cp-kafka:latest
command:
- /bin/sh
- -c
- |
kafka-console-consumer \
--bootstrap-server kafka.con.svc.cluster.local:9071 \
--topic elastic-0 \
--consumer.config /mnt/kafka-ssl.properties
volumeMounts:
- name: kafka-properties
mountPath: /mnt
readOnly: true
- name: kafka-client-truststore
mountPath: /mnt/sslcerts
resources:
requests:
memory: 512Mi # 768Mi
cpu: 500m # 1000m
volumes:
- name: kafka-properties # Create secret with name `kafka-client-config` with client configurations
secret:
secretName: kafka-client-config
- name: kafka-client-truststore
secret:
secretName: kafka-generated-jks
---
apiVersion: v1
kind: Service
metadata:
name: elastic
spec:
clusterIP: None
---
apiVersion: platform.confluent.io/v1beta1
kind: KafkaTopic
metadata:
name: elastic-0
namespace: con
spec:
replicas: 1
partitionCount: 1
configs:
cleanup.policy: "delete"