mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Add termination hook to the startup script - GCE Windows
This commit is contained in:
parent
1f8b1b84fb
commit
aa9380e017
@ -205,5 +205,8 @@ catch {
|
|||||||
Write-Host 'Exception caught in script:'
|
Write-Host 'Exception caught in script:'
|
||||||
Write-Host $_.InvocationInfo.PositionMessage
|
Write-Host $_.InvocationInfo.PositionMessage
|
||||||
Write-Host "Kubernetes Windows node setup failed: $($_.Exception.Message)"
|
Write-Host "Kubernetes Windows node setup failed: $($_.Exception.Message)"
|
||||||
|
# Make sure kubelet won't remain running in case any failure happened during the startup.
|
||||||
|
Write-Host "Cleaning up, Unregistering WorkerServices..."
|
||||||
|
Unregister-WorkerServices
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@ -1286,6 +1286,12 @@ function Start-WorkerServices {
|
|||||||
Log-Output "Kubernetes components started successfully"
|
Log-Output "Kubernetes components started successfully"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Stop and unregister both kubelet & kube-proxy services.
|
||||||
|
function Unregister-WorkerServices {
|
||||||
|
& sc.exe delete kube-proxy
|
||||||
|
& sc.exe delete kubelet
|
||||||
|
}
|
||||||
|
|
||||||
# Wait for kubelet and kube-proxy to be ready within 10s.
|
# Wait for kubelet and kube-proxy to be ready within 10s.
|
||||||
function WaitFor_KubeletAndKubeProxyReady {
|
function WaitFor_KubeletAndKubeProxyReady {
|
||||||
$waited = 0
|
$waited = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user