forked from Yolean/kubernetes-kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents-kube-kafka.yml
52 lines (52 loc) · 1.24 KB
/
events-kube-kafka.yml
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
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: events-kube-kafka
namespace: kafka
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
# prefer duplicate events over missed
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app: events
from: kube
to: kafka
template:
metadata:
labels:
app: events
from: kube
to: kafka
spec:
containers:
- name: kafkacat-curl
image: solsson/kafkacat-curl@sha256:b5484379301937129e67550331782a0f7ac030a4b913a254d084faea4bcf44a2
env:
- name: BOOTSTRAP
value: bootstrap.kafka:9092
- name: TOPIC
value: ops.kube-events-all.stream.json.001
command:
- /bin/bash
- -ec
- >
curl
-f
-s
-S
--cacert /run/secrets/kubernetes.io/serviceaccount/ca.crt
--header "Authorization: Bearer $(cat /run/secrets/kubernetes.io/serviceaccount/token)"
https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1/watch/events
|
kafkacat
-b $BOOTSTRAP
-t $TOPIC
-P
-z snappy
-v
-d broker,topic