Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly set kubelet's log files in Prepare-Node.ps1 on Windows #6221

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,11 @@ function collect_windows_network_info_and_logs {
ssh -o StrictHostKeyChecking=no -n administrator@${IP} "powershell.exe Get-HNSNetwork" > "${NODE_NETWORK_INFO_PATH}/hns_network"
ssh -o StrictHostKeyChecking=no -n administrator@${IP} "powershell.exe Get-HNSEndpoint" > "${NODE_NETWORK_INFO_PATH}/hns_endpoint"

echo "=== Collecting '${NODENAME}' kubelet and docker logs after failure ==="
echo "=== Collecting '${NODENAME}' kubelet logs after failure ==="
KUBELET_LOG_PATH="${DEBUG_LOG_PATH}/${NODENAME}/kubelet"
mkdir "${KUBELET_LOG_PATH}"
scp -q -o StrictHostKeyChecking=no -T administrator@${IP}:/cygdrive/c/var/log/kubelet/* "${KUBELET_LOG_PATH}"

DOCKER_LOG_PATH="${DEBUG_LOG_PATH}/${NODENAME}/docker"
mkdir "${DOCKER_LOG_PATH}"
scp -q -o StrictHostKeyChecking=no -T administrator@${IP}:'/cygdrive/c/"Program Files"/Docker/dockerd.log*' "${DOCKER_LOG_PATH}"
done
set -e
tar zcf debug_logs.tar.gz "${DEBUG_LOG_PATH}"
Expand Down
6 changes: 6 additions & 0 deletions hack/windows/Prepare-Node.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ Write-Host "Registering kubelet service"
nssm install kubelet $global:Powershell $global:PowershellArgs $global:StartKubeletScript

nssm set kubelet DependOnService $ContainerRuntime
nssm set kubelet AppStdout C:\var\log\kubelet\kubelet.log
# Replace kubelet.log on every service restart
nssm set kubelet AppStdoutCreationDisposition 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a comment there explaining what this does (setting AppStdoutCreationDisposition to 2)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antoninbas could you share your thoughts on this ask about if we need to keep collecting kubelet logs on Windows in the support bundle?

nssm set kubelet AppStderr C:\var\log\kubelet\kubelet.err.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the path in CI support bundle should also be updated?

# Replace kubelet.err.log on every service restart
nssm set kubelet AppStderrCreationDisposition 2

New-NetFirewallRule -Name kubelet -DisplayName 'kubelet' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 10250

Expand Down
Loading