Skip to content

Commit

Permalink
Adds topic and test for fluent/fluent-bit-kubernetes-logging#11
Browse files Browse the repository at this point in the history
but beware of the aggregation recursion with the test,
you'll see escaped escaped ... escaped json.
  • Loading branch information
solsson committed Dec 19, 2017
1 parent 4845912 commit 677fcc8
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
75 changes: 75 additions & 0 deletions logs-streaming/test/logs-fluentbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
kind: ConfigMap
metadata:
name: logs-fluentbit
namespace: test-kafka
apiVersion: v1
data:

setup.sh: |-
touch /tmp/testlog
tail -f /tmp/testlog
test.sh: |-
exec >> /tmp/testlog
exec 2>&1
echo ""
echo "{\"#---\":\"$(date -u --iso-8601='ns')\"}"
kafkacat -b $BOOTSTRAP -C -t $TOPIC -f '{"#topic":"%t","#partition":%p,"#offset":%o,"#key":"%k","=":%s}\n' -o -10 -e -q
exit 0
quit-on-nonzero-exit.sh: |-
exit 0
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: logs-fluentbit
namespace: test-kafka
spec:
replicas: 1
selector:
matchLabels:
test-target: logs-streaming-fluentbit
test-type: readiness
template:
metadata:
labels:
test-target: logs-streaming-fluentbit
test-type: readiness
spec:
containers:
- name: testcase
image: solsson/kafkacat@sha256:ebebf47061300b14a4b4c2e1e4303ab29f65e4b95d34af1b14bb8f7ec6da7cef
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-fluentbit-001
command:
- /bin/bash
- -e
- /test/setup.sh
readinessProbe:
exec:
command:
- /bin/bash
- -e
- /test/test.sh
livenessProbe:
exec:
command:
- /bin/bash
- -e
- /test/quit-on-nonzero-exit.sh
volumeMounts:
- name: config
mountPath: /test
volumes:
- name: config
configMap:
name: logs-fluentbit
32 changes: 32 additions & 0 deletions logs-streaming/topic-fluent-bit-kubernetes-logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: batch/v1
kind: Job
metadata:
name: topic-ops-kube-logs-fluentbit
# same namespace as https://github.com/fluent/fluent-bit-kubernetes-logging
namespace: logging
spec:
template:
metadata:
labels:
app: topic-create
topic-id: ops-kube-logs-fluentbit
topic-gen: "001"
spec:
containers:
- name: kafka
image: solsson/kafka:1.0.0@sha256:17fdf1637426f45c93c65826670542e36b9f3394ede1cb61885c6a4befa8f72d
command:
- ./bin/kafka-topics.sh
- --zookeeper
- zookeeper.kafka:2181
- --create
- --if-not-exists
- --topic
- ops-kube-logs-fluentbit-001
- --partitions
- "1"
- --replication-factor
- "2"
- --config
- retention.ms=6912500000
restartPolicy: Never

0 comments on commit 677fcc8

Please sign in to comment.