I try to use fluentd to read the kubernetes pod log files on a windows k8s cluster (yes, windows version k8s cluster).
I found that, all the kubernetes pod log is under
C:/var/log folder on the host OS, so I plan to mount this folder into the fluentd container so that fluentd can read it.
Because I found that all the files under
C:/var/log folder is symlink files, and the real target file is under
C:\ProgramData\docker, so I mount both folder into the pod, because I think the symlink files need the targeting files as well.
But I found that, fluentd can read the read file (under
C:\ProgramData\docker) but cannot read via symlink file under
So I remote to my windows node and try to verify by running:
$ docker run --rm -v c:/var/log:c:/var/log -v c:/ProgramData/docker:c:/ProgramData/docker -it mcr.microsoft.com/powershell powershell
And got the following result:
PS C:\var\log\containers> type .\speller-col2-65679699c6-hjvhw_speller_speller-col2-ddd1788228d99678c04e85cc2438cb1646667ee0c751a9768b53da92df9f3103.log type : The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached. At line:1 char:1 + type .\speller-col2-65679699c6-hjvhw_speller_speller-col2-ddd1788228d ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ReadError: (C:\var\log\cont...a92df9f3103.log:String) [Get-Content], IOException + FullyQualifiedErrorId : GetContentReaderIOError,Microsoft.PowerShell.Commands.GetContentCommand
I try to read the real log file ( which those symlink files point to), and I can get the content correctly. But when I try to read via the symlink files, it fails. I believe that’s why the fluentd cannot work as well.
I try to google but I don’t find any clue. Is there anyone who has tried the same case before or anyone who can share some idea that I can try?