Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions pkg/cmd/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
10 changes: 8 additions & 2 deletions pkg/cmd/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/url"
"os"
"strconv"
"strings"

kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
Expand Down Expand Up @@ -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()

Expand All @@ -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") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the BindAddr includes other IPs, then a container that knew where it was located would be able to communicate, wouldn't it? We may not wire it up that way by default, but I'm pretty sure it could be done with a cleverly built .kubeconfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the most common case is "no non-loop back ip", but it's not totally invalid.

On Mar 13, 2015, at 7:43 AM, David Eads [email protected] wrote:

In pkg/cmd/server/start.go:

@@ -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") {
    If the BindAddr includes other IPs, then a container that knew where it was located would be able to communicate, wouldn't it? We may not wire it up that way by default, but I'm pretty sure it could be done with a cleverly built .kubeconfig.


Reply to this email directly or view it on GitHub.

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())
Expand Down