mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Allow (delayed) apiserver starting when network interface isn't available immediately.
This commit is contained in:
parent
39fba7c8d5
commit
c163535563
@ -191,7 +191,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
defer util.HandleCrash()
|
defer util.HandleCrash()
|
||||||
glog.Fatal(readOnlyServer.ListenAndServe())
|
for {
|
||||||
|
if err := readOnlyServer.ListenAndServe(); err != nil {
|
||||||
|
glog.Errorf("Unable to listen for read only traffic (%v); will try again.", err)
|
||||||
|
}
|
||||||
|
time.Sleep(15 * time.Second)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ func setDefaults(c *Config) {
|
|||||||
if c.ReadWritePort == 0 {
|
if c.ReadWritePort == 0 {
|
||||||
c.ReadWritePort = 443
|
c.ReadWritePort = 443
|
||||||
}
|
}
|
||||||
if c.PublicAddress == "" {
|
for c.PublicAddress == "" {
|
||||||
// Find and use the first non-loopback address.
|
// Find and use the first non-loopback address.
|
||||||
// TODO: potentially it'd be useful to skip the docker interface if it
|
// TODO: potentially it'd be useful to skip the docker interface if it
|
||||||
// somehow is first in the list.
|
// somehow is first in the list.
|
||||||
@ -173,7 +173,9 @@ func setDefaults(c *Config) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
glog.Fatalf("Unable to find suitible network address in list: %v", addrs)
|
glog.Errorf("Unable to find suitible network address in list: '%v'\n"+
|
||||||
|
"Will try again in 5 seconds. Set the public address directly to avoid this wait.", addrs)
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user