diff --git a/Godeps/_workspace/src/github.com/skynetservices/skydns/server/config.go b/Godeps/_workspace/src/github.com/skynetservices/skydns/server/config.go index 893a578cc04e..7535e9ead1f1 100644 --- a/Godeps/_workspace/src/github.com/skynetservices/skydns/server/config.go +++ b/Godeps/_workspace/src/github.com/skynetservices/skydns/server/config.go @@ -7,6 +7,7 @@ package server import ( "fmt" "net" + "os" "strings" "time" @@ -105,7 +106,14 @@ func SetDefaults(config *Config) error { if len(config.Nameservers) == 0 { c, err := dns.ClientConfigFromFile("/etc/resolv.conf") - if err != nil { + if os.IsNotExist(err) { + c = &dns.ClientConfig{ + Port: "53", + Ndots: 1, + Timeout: 1, + Attempts: 2, + } + } else if err != nil { return err } for _, s := range c.Servers { diff --git a/pkg/cmd/server/config.go b/pkg/cmd/server/config.go index d11a097af699..92413d2a0aeb 100644 --- a/pkg/cmd/server/config.go +++ b/pkg/cmd/server/config.go @@ -138,12 +138,16 @@ func (cfg Config) GetMasterAddress() (*url.URL, error) { } // use the default ip address for the system - addr, err := util.DefaultLocalIP4() - if err != nil { + addr := "" + if ip, err := util.DefaultLocalIP4(); err == nil { + addr = ip.String() + } else if err == util.ErrorNoDefaultIP { + addr = "127.0.0.1" + } else if err != nil { return nil, fmt.Errorf("Unable to find a public IP address: %v", err) } - masterAddr := scheme + "://" + net.JoinHostPort(addr.String(), strconv.Itoa(port)) + masterAddr := scheme + "://" + net.JoinHostPort(addr, strconv.Itoa(port)) return url.Parse(masterAddr) } diff --git a/pkg/cmd/server/start.go b/pkg/cmd/server/start.go index d09ea0588771..6d35540a922f 100644 --- a/pkg/cmd/server/start.go +++ b/pkg/cmd/server/start.go @@ -7,6 +7,7 @@ import ( "net/url" "os" "strconv" + "strings" kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities" @@ -40,12 +41,13 @@ func (cfg Config) startMaster() error { if cfg.StartKube { cfg.MintSystemClientCert("kube-client") } - glog.Infof(" Client certificates and .kubeconfig files generated in %v", cfg.CertDir) + glog.Infof("Client certificates and .kubeconfig files generated in %v", cfg.CertDir) openshiftConfig, err := cfg.BuildOriginMasterConfig() if err != nil { return err } + // must start policy caching immediately openshiftConfig.RunPolicyCache() @@ -54,7 +56,11 @@ func (cfg Config) startMaster() error { return err } - glog.Infof(" Nodes: %v", cfg.NodeList) + glog.Infof("Nodes: %v", cfg.NodeList) + + if strings.Contains(openshiftConfig.MasterAddr, "127.0.0.1") { + glog.Infof("WARNING: Your server is being advertised only to the host - containers will not be able to communicate with the master without a proxy") + } if cfg.StartKube { kubeConfig, err := cfg.BuildKubernetesMasterConfig(openshiftConfig.RequestContextMapper, openshiftConfig.KubeClient())