Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

set FailureActions for docker, kubelet, kubeproxy on windows #3905

Merged
merged 1 commit into from
Oct 22, 2018
Merged
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
11 changes: 11 additions & 0 deletions parts/k8s/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,14 @@ Set-Explorer
New-ItemProperty -Path HKLM:"\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Main" -Name "Start Page" -Type String -Value http://bing.com
}

function
Update-ServiceFailureActions()
{
sc.exe failure "kubelet" actions= restart/60000/restart/60000/restart/60000 reset= 900
sc.exe failure "kubeproxy" actions= restart/60000/restart/60000/restart/60000 reset= 900
sc.exe failure "docker" actions= restart/60000/restart/60000/restart/60000 reset= 900
}

try
{
# Set to false for debugging. This will output the start script to
Expand Down Expand Up @@ -723,6 +731,9 @@ try
Write-Log "Start preProvisioning script"
PREPROVISION_EXTENSION

Write-Log "Update service failure actions"
Update-ServiceFailureActions

Write-Log "Setup Complete, reboot computer"
Restart-Computer
}
Expand Down