Skip to content

Commit

Permalink
Explicitly configure kubelet logging in Prepare-Node.ps1 (#6221)
Browse files Browse the repository at this point in the history
Fixes #6219 

Signed-off-by: Wenying Dong <wenyingd@vmware.com>
  • Loading branch information
wenyingd authored Apr 18, 2024
1 parent 4bc74d2 commit e24ae71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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
nssm set kubelet AppStderr C:\var\log\kubelet\kubelet.err.log
# 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

0 comments on commit e24ae71

Please sign in to comment.