blob: 062d097c6304d323a1da375c85d28a8efe9c3437 (
plain) (
blame)
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
|
apiVersion: extensions/v1beta1
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
template:
metadata:
labels:
app: events
from: kube
to: kafka
spec:
containers:
- name: kafkacat-curl
image: solsson/kafkacat-curl@sha256:6ad61f2e6343359c3972d7a86815568c0a1d0560068134c5d702a152eb5123a0
env:
- name: BOOTSTRAP
value: kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092,kafka-2.broker.kafka.svc.cluster.local:9092
- name: TOPIC
value: ops-kube-events-all-json-001
command:
- /bin/bash
- -ec
# curl errors will go to kafka, kafkacat errors will got to log
- >
echo "Started at $(date -u +%FT%TZ) producing to $TOPIC"
;
curl
-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
|