aboutsummaryrefslogtreecommitdiff
path: root/logs-streaming/test/logs-fluentbit.yml
blob: 86af0e3b1fd95927a985ecbde9b5b919ec9f378e (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
72
73
74
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: bootstrap.kafka:9092
        - name: TOPIC
          value: ops.kube-logs-fluentbit.stream.json.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