私有云部署kubesphere 3.4.1 EFK日志系统都是正常的,现在部署生产了确看不到日志,本地私有云和云端的操作系统都是Ubuntu 22.04 CRI:containerd kubesphere:v3.4.1 k8s:v1.25.6
containerd.lua:
function containerd( tag, timestamp, record)
if(record["logtag"]\~=nil)
then
timeStr = os.date("!\*t", timestamp["sec"])
t = string.format("%4d-%02d-%02dT%02d:%02d:%02d.%sZ",
timeStr["year"], timeStr["month"], timeStr["day"],
timeStr["hour"], timeStr["min"], timeStr["sec"],
timestamp["nsec"]);
record["time"] = t;
record["log"] = record["message"];
record["message"] = nil;
return 1, timestamp, record
else
return 0,timestamp,record
end
end
fluent-bit.conf:
[Service]
Parsers_File parsers.conf
[Input]
Name systemd
Path /var/log/journal
DB /fluent-bit/tail/docker.db
DB.Sync Normal
Tag service.containerd
Systemd_Filter _SYSTEMD_UNIT=containerd.service
[Input]
Name systemd
Path /var/log/journal
DB /fluent-bit/tail/kubelet.db
DB.Sync Normal
Tag service.kubelet
Systemd_Filter _SYSTEMD_UNIT=kubelet.service
[Input]
Name tail
Path /var/log/containers/\*.log
Exclude_Path /var/log/containers/\*_kubesphere-logging-system_events-exporter\*.log,/var/log/containers/kube-auditing-webhook\*_kubesphere-logging-system_kube-auditing-webhook\*.log
Refresh_Interval 10
Skip_Long_Lines true
DB /fluent-bit/tail/pos.db
DB.Sync Normal
Mem_Buf_Limit 5MB
Parser cri
Tag kube.\*
[Filter]
Name lua
Match kube.\*
script /fluent-bit/config/containerd.lua
call containerd
time_as_table true
[Filter]
Name kubernetes
Match kube.\*
Kube_URL https://kubernetes.default.svc:443
Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
Labels false
Annotations false
[Filter]
Name nest
Match kube.\*
Operation lift
Nested_under kubernetes
Add_prefix kubernetes_
[Filter]
Name modify
Match kube.\*
Remove stream
Remove kubernetes_pod_id
Remove kubernetes_host
Remove kubernetes_container_hash
[Filter]
Name nest
Match kube.\*
Operation nest
Wildcard kubernetes_\*
Nest_under kubernetes
Remove_prefix kubernetes_
[Filter]
Name lua
Match service.\*
script /fluent-bit/config/systemd.lua
call add_time
time_as_table true
[Output]
Name opensearch
Match_Regex (?:kube|service)\\.(.\*)
Host opensearch-cluster-data.kubesphere-logging-system.svc
Port 9200
HTTP_User xxxxxx
HTTP_Passwd xxxxxx
Logstash_Format true
Logstash_Prefix ks-whizard-logging
Time_Key @timestamp
Suppress_Type_Name true
tls On
tls.verify false