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 {
205
205
Write-Host ' Exception caught in script:'
206
206
Write-Host $_.InvocationInfo.PositionMessage
207
207
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
208
211
exit 1
209
212
}
Original file line number Diff line number Diff line change @@ -1286,6 +1286,12 @@ function Start-WorkerServices {
1286
1286
Log- Output " Kubernetes components started successfully"
1287
1287
}
1288
1288
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
+
1289
1295
# Wait for kubelet and kube-proxy to be ready within 10s.
1290
1296
function WaitFor_KubeletAndKubeProxyReady {
1291
1297
$waited = 0
You can’t perform that action at this time.
0 commit comments