blob: 56fbeea171ee38f6c600480505cdb1eb40b38d60 (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
name: logs-kafka
namespace: kafka
spec:
selector:
matchLabels:
k8s-app: logs-kafka
version: v1
kubernetes.io/cluster-service: "true"
template:
metadata:
labels:
k8s-app: logs-kafka
version: v1
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: kafkacat
image: solsson/kafkacat@sha256:ebebf47061300b14a4b4c2e1e4303ab29f65e4b95d34af1b14bb8f7ec6da7cef
command:
- sh
- -ec
- >
find /var/log/containers/ -maxdepth 1 -name *.log | tee /tmp/start-list;
cd /var/log/containers/;
tail
-n 0
--follow=name
*.log
|
kafkacat
-b kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092,kafka-2.broker.kafka.svc.cluster.local:9092
-t ops-kube-logs-raw-001
-P
-z snappy
-v
-d broker,topic
livenessProbe:
exec:
command:
- /bin/sh
- -c
- find /var/log/containers/ -maxdepth 1 -name *.log | diff - /tmp/start-list
initialDelaySeconds: 15
periodSeconds: 5
resources:
limits:
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: varlog
mountPath: /var/log
readOnly: true
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
terminationGracePeriodSeconds: 10
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
|