File tree Expand file tree Collapse file tree 3 files changed +91
-0
lines changed
actions/archive-artifacts Expand file tree Collapse file tree 3 files changed +91
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,13 @@ runs:
147147 kubectl get zenkodrsource -A -o yaml > /tmp/artifacts/data/${STAGE}/kind-logs/all-zenkodrsources.log || true
148148 kubectl get zenkodrsink -A -o yaml > /tmp/artifacts/data/${STAGE}/kind-logs/all-zenkodrsinks.log || true
149149 kind export logs /tmp/artifacts/data/${STAGE}/kind-logs/kind-export || true
150+ cp -r /artifacts/data/fluentbit-logs /tmp/artifacts/data/${STAGE}/kind-logs/fluentbit-logs 2>/dev/null || true
151+ for container_log in /tmp/artifacts/data/${STAGE}/kind-logs/kind-export/*/containers/*.log; do
152+ [ -f "$container_log" ] || continue
153+ fb_file="/tmp/artifacts/data/${STAGE}/kind-logs/fluentbit-logs/$(basename "$container_log")"
154+ [ -f "$fb_file" ] || continue
155+ ln -sf "../../../fluentbit-logs/$(basename "$container_log")" "$container_log"
156+ done
150157 tar zcvf /tmp/artifacts/${{ github.sha }}-${STAGE}-logs-volumes.tgz /tmp/artifacts/data/${STAGE}/kind-logs
151158 env :
152159 STAGE : ${{ inputs.stage }}
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : ConfigMap
3+ metadata :
4+ name : fluent-bit-config
5+ data :
6+ fluent-bit.conf : |
7+ [SERVICE]
8+ Flush 5
9+ Log_Level warn
10+
11+ [INPUT]
12+ Name tail
13+ Tag <basename>
14+ Tag_Regex /var/log/containers/(?<basename>[^/]+)$
15+ Path /var/log/containers/*.log
16+ DB /var/lib/fluent-bit/flb_kube.db
17+ Mem_Buf_Limit 16MB
18+ Skip_Long_Lines On
19+
20+ [OUTPUT]
21+ Name file
22+ Match *
23+ Path /data/fluentbit-logs/
24+ Mkdir true
25+ Format template
26+ Template {log}
27+ ---
28+ apiVersion : apps/v1
29+ kind : DaemonSet
30+ metadata :
31+ name : fluent-bit
32+ labels :
33+ app : fluent-bit
34+ spec :
35+ selector :
36+ matchLabels :
37+ app : fluent-bit
38+ template :
39+ metadata :
40+ labels :
41+ app : fluent-bit
42+ spec :
43+ tolerations :
44+ - key : node-role.kubernetes.io/control-plane
45+ effect : NoSchedule
46+ containers :
47+ - name : fluent-bit
48+ image : cr.fluentbit.io/fluent/fluent-bit:4.0
49+ resources :
50+ requests :
51+ cpu : 50m
52+ memory : 64Mi
53+ limits :
54+ cpu : 200m
55+ memory : 128Mi
56+ volumeMounts :
57+ - name : varlog
58+ mountPath : /var/log
59+ readOnly : true
60+ - name : fluentbit-output
61+ mountPath : /data/fluentbit-logs
62+ - name : fluentbit-db
63+ mountPath : /var/lib/fluent-bit
64+ - name : config
65+ mountPath : /fluent-bit/etc
66+ volumes :
67+ - name : varlog
68+ hostPath :
69+ path : /var/log
70+ - name : fluentbit-output
71+ hostPath :
72+ path : /data/fluentbit-logs
73+ type : DirectoryOrCreate
74+ - name : fluentbit-db
75+ emptyDir : {}
76+ - name : config
77+ configMap :
78+ name : fluent-bit-config
Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ helm repo add --force-update banzaicloud-stable https://kubernetes-charts.banzai
5959 }
6060helm repo update
6161
62+ # fluent-bit log collector — captures container logs before pod deletion
63+ if [ " ${CI:- } " = " true" ]; then
64+ kubectl apply -f $DIR /configs/fluentbit.yaml
65+ kubectl rollout status daemonset/fluent-bit --timeout=5m
66+ fi
67+
6268# nginx-controller
6369kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/${INGRESS_NGINX_VERSION} /deploy/static/provider/kind/deploy.yaml
6470kubectl rollout status -n ingress-nginx deployment/ingress-nginx-controller --timeout=10m
You can’t perform that action at this time.
0 commit comments