mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Log e2e-node kubelet output directly to file
For some reason when we send them to journald, many log lines are consistently dropped as soon as the PLEG is started. If we log directly to file, we don't have this problem. As a bonus, if the tests crash, the kubelet logs will always be available since they were already written; otherwise we normally wait until the end of the test run to collect them from journald, meaning that we often end up with empty logs.
This commit is contained in:
parent
5be21c50c2
commit
a77f4f4c29
@ -194,6 +194,7 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
||||
cmdArgs = append(cmdArgs,
|
||||
systemdRun,
|
||||
"-p", "Delegate=true",
|
||||
"-p", "StandardError=file:"+framework.TestContext.ReportDir+"/kubelet.log",
|
||||
"--unit="+unitName,
|
||||
"--slice=runtime.slice",
|
||||
"--remain-after-exit",
|
||||
@ -201,10 +202,6 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
||||
|
||||
killCommand = exec.Command("systemctl", "kill", unitName)
|
||||
restartCommand = exec.Command("systemctl", "restart", unitName)
|
||||
e.logs["kubelet.log"] = LogFileData{
|
||||
Name: "kubelet.log",
|
||||
JournalctlCommand: []string{"-u", unitName},
|
||||
}
|
||||
|
||||
kc.KubeletCgroups = "/kubelet.slice"
|
||||
kubeletConfigFlags = append(kubeletConfigFlags, "kubelet-cgroups")
|
||||
|
Loading…
Reference in New Issue
Block a user