blob: 170a2f9da1a7902c6aac55ef3aff68773f1c53d6 (
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
69
70
71
|
---
kind: ConfigMap
metadata:
name: test-logs-aggregated
namespace: test-kafka
apiVersion: v1
data:
setup.sh: |-
touch /tmp/testlog
tail -f /tmp/testlog
continue.sh: |-
echo "--- $(date -u --iso-8601='ns') ---" >> /tmp/testlog
kafkacat -b $BOOTSTRAP -C -t $TOPIC -f '%t [%p] %o: %k = %s\n' -o -10 -e >> /tmp/testlog
exit 0
run.sh: |-
exit 0
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: test-logs-aggregated
namespace: test-kafka
spec:
replicas: 1
template:
metadata:
labels:
test-target: kafka
test-type: readiness
spec:
containers:
- name: testcase
image: solsson/kafkacat@sha256:9cee76d02eee590c4874c42ca2e10de22d15c2dfa5b67205e35089a49cfba1f4
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-logs-raw-001
# Test set up
command:
- /bin/bash
- -e
- /test/setup.sh
# Test run, again and again
readinessProbe:
exec:
command:
- /bin/bash
- -e
- /test/run.sh
# Test quit on nonzero exit
livenessProbe:
exec:
command:
- /bin/bash
- -e
- /test/continue.sh
volumeMounts:
- name: config
mountPath: /test
volumes:
- name: config
configMap:
name: test-logs-aggregated
|