Allow (delayed) apiserver starting when network interface isn't available.

Closes #2176
Binding to all address is a late-binding "all".  Observe:


#
# Bring up a new interface, prove that port 93 is dead
#

# ifconfig eth0:0 10.8.6.7 up

# netcat 10.8.6.7 93 -w1
(UNKNOWN) [10.8.6.7] 93 (?) : Connection refused

# ifconfig eth0:0 10.8.6.7 down

#
# Put something on port 93 and prove it is alive
#

# while true; do date | netcat -l -p 93 -q0; done &
[1] 27041

# netcat localhost 93
Fri Nov  7 21:23:34 UTC 2014

# netcat 10.8.6.7 93 -w1
(UNKNOWN) [10.8.6.7] 93 (?) : Connection timed out

#
# Bring up a new interface and see what happens to port 93
#

# ifconfig eth0:0 10.8.6.7 up

# netcat 10.8.6.7 93 -w1
Fri Nov  7 21:23:40 UTC 2014


On Thu, Nov 6, 2014 at 9:44 AM, Daniel Smith <notifications@github.com>
wrote:

> In cmd/apiserver/apiserver.go:
>
> > @@ -191,7 +191,12 @@ func main() {
> >  		}
> >  		go func() {
> >  			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)
>
> The scenario is the important interface doesn't exist yet, because it's
> slow starting. (IRC report of this actually happening prompted this change.)
>
> Does binding to all addresses magically cause you to also bind to new
> addresses when they show up? I didn't expect so, hence this retry loop.
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/2180/files#r19960624>
> .
>