Fix cni cleanup during kubelet start to be graceful & not loose any logs (#3618)

This commit is contained in:
Madhan Raj Mookkandy 2018-08-07 14:16:04 -07:00 коммит произвёл Jack Francis
Родитель 300accb434
Коммит d7cf2de0ae
1 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@ -386,9 +386,31 @@ if (`$hnsNetwork)
Write-Host "Cleaning up old HNS network found"
Remove-HnsNetwork `$hnsNetwork
Start-Sleep 10
`$cnijson = "$global:KubeDir" + "\azure-vnet*"
remove-item `$cnijson -ErrorAction SilentlyContinue
# Kill all cni instances & stale data left by cni
# Cleanup all files related to cni
`$cnijson = "$global:KubeDir" + "\azure-vnet-ipam.json"
if ((Test-Path `$cnijson))
{
Remove-Item `$cnijson
}
`$cnilock = "$global:KubeDir" + "\azure-vnet-ipam.lock"
if ((Test-Path `$cnilock))
{
Remove-Item `$cnilock
}
taskkill /IM azure-vnet-ipam.exe /f
`$cnijson = "$global:KubeDir" + "\azure-vnet.json"
if ((Test-Path `$cnijson))
{
Remove-Item `$cnijson
}
`$cnilock = "$global:KubeDir" + "\azure-vnet.lock"
if ((Test-Path `$cnilock))
{
Remove-Item `$cnilock
}
taskkill /IM azure-vnet.exe /f
}
# Restart Kubeproxy, which would wait, until the network is created