Product Version: 1.19+
apiVersion: pksapi.io/v1beta1 kind: LogSink metadata: name: logsinktest namespace: dev spec: enable_tls: true host: SYSLOGSERVERIP port: 514 type: syslog
This should be also reflected in the following:
kubectl get configmaps -n pks-system -oyaml fluent-bit
In the YAML config you should see the following section:
[OUTPUT] Name syslog Match * InstanceName logsinktest Addr SYSLOGSERVERIP:514 Namespace default
The same config details can be found in the fluent-bit pod under: /fluent-bit/etc/fluent-bit.conf (cat /fluent-bit/etc/outputs.conf)
Next, allocate the pod that is generating logs and confirm the logs are flowing:
kubectl logs logger -n default -f
In a new window, go to the fluent-bit pod running on the same worker as the log generating pod:
kubectl get logger -owide -n default Confirm the worker ID kubectl get pod -n pks-system -owide Get the ID of the fluent-bit pod running on the same worker as logger kubectl exec -n pks-system fluent-bit-ID -it bash
Run tail -f on the logging pod under the following location:
/var/logs/pods/default_logger_76fe1c4c-0d29-4dc8-a87d-906c6bafc67f/logger/0.logtcpdump -n port 514 and host SYSLOGSERVERIP (optionally add -w /tmp/worker.pcap for more detailed analysis) Explore the pcap file with wireshark and filter for content: frame contains "default"
Then confirm that the logs visible from Fluent Bit are also sent to syslog:
tcpdump -n port 514 and host 10.213.48.132 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 20:56:08.000577 IP 10.213.48.220.34378 > 10.213.48.132.514: Flags [P.], seq 3119020594:3119020832, ack 1686853298, win 507, options [nop,nop,TS val 3915994610 ecr 3297830605], length 238 20:56:08.000841 IP 10.213.48.132.514 > 10.213.48.220.34378: Flags [.], ack 238, win 2498, options [nop,nop,TS val 3297832605 ecr 3915994610], length 0 20:56:09.000555 IP 10.213.48.220.34378 > 10.213.48.132.514: Flags [P.], seq 238:606, ack 1, win 507, options [nop,nop,TS val 3915995610 ecr 3297832605], length 368 20:56:09.000612 IP 10.213.48.220.34378 > 10.213.48.132.514: Flags [P.], seq 606:845, ack 1, win 507, options [nop,nop,TS val 3915995610 ecr 3297832605], length 239 20:56:09.000759 IP 10.213.48.132.514 > 10.213.48.220.34378: Flags [.], ack 606, win 2498, options [nop,nop,TS val 3297833604 ecr 3915995610], length 0 20:56:09.000777 IP 10.213.48.132.514 > 10.213.48.220.34378: Flags [.], ack 845, win 2498, options [nop,nop,TS val 3297833604 ecr 3915995610], length 0 20:56:09.000891 IP 10.213.48.220.34402 > 10.213.48.132.514: Flags [P.], seq 3122056594:3122056967, ack 1593739083, win 507, options [nop,nop,TS val 3915995610 ecr 3297829604], length 373 20:56:09.001073 IP 10.213.48.132.514 > 10.213.48.220.34402: Flags [.], ack 373, win 2416, options [nop,nop,TS val 3297833605 ecr 3915995610], length 0 ^C 8 packets captured 8 packets received by filter 0 packets dropped by kernelTo further confirm syslog is receiving the messages, tcpdump can be executed on the syslog server side.