kubernetes: podLogsDir validation of default value breaks on windows
What happened?
Kubelet: a custom root directory for pod logs (instead of default /var/log/pods) can be specified using the podLogsDir key in kubelet configuration. (https://github.com/kubernetes/kubernetes/pull/112957, @mxpv) [SIG API Machinery, Node, Scalability and Testing]
podLogsDir is not added in cmd/kubelet/app/options/options.go so I can’t use this flag when running kubelet v1.30.0-beta.0.
also, when I ran it in windows (it’s fine when I ran it in linux), I got invalid configuration: pod logs path \"/var/log/pods\" must be absolute path, invalid configuration: pod logs path \"/var/log/pods\" must be normalized. Notice there are unexpected \ before quotes.
What did you expect to happen?
I should be able to run kubelet with --pod-logs-dir. If I don’t use this flag, it should correctly use default value.
How can we reproduce it (as minimally and precisely as possible)?
run newest kubelet on windows node with some necessary parameters
./kubelet --version
> Kubernetes v1.30.0-beta.0
Anything else we need to know?
No response
Kubernetes version
$ kubectl version
# paste output here
Cloud provider
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, …) and versions (if applicable)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (29 by maintainers)
@HuShaoRu It is intentional that it is an option only added to the config file (https://github.com/kubernetes/kubernetes/issues/124076#issuecomment-2022722888).
But those details helped, I am now able to reproduce your scenario. It would be helpful if you shared the command line you do run (minus any sensitive info).
with 1.30, Running with the bare minimal kubelet command line args we get:
with 1.29, It starts up:
So there are two issues:
resolveRelativePathscode path andfilepath.IsAbs(*path)which it is treating it like a relative path which could end up putting the path somewhere not expected.For 1) I can see it going either way. In this case the default provided should be respected, but at some future release we might need to say that the config is required.
this is related to my open PR here:
the kubelet on Windows should not throw errors with the defaults (which are Linux defaults).
Turns out there are some failing and flaky tests in the Windows unit tests. I am hoping we can disable them for now and keep enabling them as they are fixed, so that we can run the passing tests by default.
+1