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:
Elana Hashman 2021-07-30 15:22:29 -07:00
parent 5be21c50c2
commit a77f4f4c29
No known key found for this signature in database
GPG Key ID: D37F7B2A20B48FA0

View File

@ -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")