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

Commit

Permalink
Fix for kubelet startup script when using azure cni
Browse files Browse the repository at this point in the history
  • Loading branch information
madhanrm committed Jun 19, 2018
1 parent 2b88659 commit b65259e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions parts/k8s/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,24 @@ Write-Host "NetworkPlugin azure, starting kubelet."
# Turn off Firewall to enable pods to talk to service endpoints. (Kubelet should eventually do this)
netsh advfirewall set allprofiles state off
# startup the service
`$hnsNetwork = Get-HnsNetwork | ? Type -EQ `$global:NetworkMode.ToLower()
if (`$hnsNetwork)
{
# Kubelet has been restarted with existing network.
# Cleanup all containers
docker ps -q | foreach {docker rm `$_ -f}
# cleanup network
Write-Host "Cleaning up old HNS network found"
Remove-HnsNetwork `$hnsNetwork
Start-Sleep 10
`$cnijson = $global:KubeDir + "\azure-vnet.json*"
remove-item `$cnijson -ErrorAction SilentlyContinue
}
Restart-Service Kubeproxy
$KubeletCommandLine
Expand Down

0 comments on commit b65259e

Please sign in to comment.