Skip to content

Commit bb11056

Browse files
authored
Antrea retry (#41)
* Antrea retries if kube proxy not online yet, restart final print services
1 parent a22dc63 commit bb11056

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

forked/1-antrea.ps1

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,19 @@ Get-Service *kube*
131131
Get-Service *antrea*
132132
Get-Service *ovs*
133133

134-
# Restart antrea, just in case needs to be done bc maybe kube proxy
135-
# wasnt initially up. TODO, should we have antrea talk directly to the
136-
# apiserver over an IP address, rather then relying on the kube-proxy SEP?
137-
start-service *antrea*
134+
##################################################
135+
# Try starting antrea. Restart it, just in case #
136+
##################################################
137+
$antrea = Get-Service -Name "antrea-agent"
138+
$antrea_starts = 0
139+
while ($antrea.Status -ne 'Running')
140+
{
141+
Write-Output("... Trying to start antrea service... $antrea_starts")
142+
Start-Service "antrea-agent"
143+
$antrea_starts = $antrea_starts + 1
144+
$antrea.Refresh()
145+
}
146+
Write-Output("Done starting antrea... ")
147+
Get-Service *kube*
148+
Get-Service *ovs*
149+
Get-Service *antrea*

sync/shared/kubejoin.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
$env:path += ";C:\Program Files\containerd"
22
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
3-
kubeadm join 10.20.30.10:6443 --cri-socket "npipe:////./pipe/containerd-containerd" --token 9n3umk.o2iqrho7rjakrqps --discovery-token-ca-cert-hash sha256:045241bfcea2c884eceef830db4dcf9432c5f0aa8d00fbe2f54710f4bc284cdb
3+
kubeadm join 10.20.30.10:6443 --cri-socket "npipe:////./pipe/containerd-containerd" --token 86039w.99bp7lykobg831qx --discovery-token-ca-cert-hash sha256:6f4cac90bb19a1af3c620eb4bbd015d00b2181653ab6f36a3bf5ebce0dc01e76

0 commit comments

Comments
 (0)