File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -205,5 +205,8 @@ catch {
205205 Write-Host ' Exception caught in script:'
206206 Write-Host $_.InvocationInfo.PositionMessage
207207 Write-Host " Kubernetes Windows node setup failed: $ ( $_.Exception.Message ) "
208+ # Make sure kubelet won't remain running in case any failure happened during the startup.
209+ Write-Host " Cleaning up, Unregistering WorkerServices..."
210+ Unregister-WorkerServices
208211 exit 1
209212}
Original file line number Diff line number Diff line change @@ -1286,6 +1286,12 @@ function Start-WorkerServices {
12861286 Log- Output " Kubernetes components started successfully"
12871287}
12881288
1289+ # Stop and unregister both kubelet & kube-proxy services.
1290+ function Unregister-WorkerServices {
1291+ & sc.exe delete kube- proxy
1292+ & sc.exe delete kubelet
1293+ }
1294+
12891295# Wait for kubelet and kube-proxy to be ready within 10s.
12901296function WaitFor_KubeletAndKubeProxyReady {
12911297 $waited = 0
You can’t perform that action at this time.
0 commit comments