Commit f8a4547b authored by Menna Elmasry's avatar Menna Elmasry Committed by Brad Davidson

Merge pull request #2448 from MonzElmasry/new_b

Make etcd use node private ip
parent 18e81842
......@@ -130,7 +130,9 @@ func run(app *cli.Context, cfg *cmds.Server) error {
if cmds.AgentConfig.FlannelIface != "" && cmds.AgentConfig.NodeIP == "" {
cmds.AgentConfig.NodeIP = netutil.GetIPFromInterface(cmds.AgentConfig.FlannelIface)
}
if serverConfig.ControlConfig.PrivateIP == "" && cmds.AgentConfig.NodeIP != "" {
serverConfig.ControlConfig.PrivateIP = cmds.AgentConfig.NodeIP
}
if serverConfig.ControlConfig.AdvertiseIP == "" && cmds.AgentConfig.NodeExternalIP != "" {
serverConfig.ControlConfig.AdvertiseIP = cmds.AgentConfig.NodeExternalIP
}
......
......@@ -137,8 +137,8 @@ type Control struct {
BindAddress string
SANs []string
Runtime *ControlRuntime `json:"-"`
PrivateIP string
Runtime *ControlRuntime `json:"-"`
}
type ControlRuntimeBootstrap struct {
......
......@@ -309,12 +309,11 @@ func (e *ETCD) Register(ctx context.Context, config *config.Control, handler htt
}
e.client = client
address, err := getAdvertiseAddress(config.AdvertiseIP)
address, err := getAdvertiseAddress(config.PrivateIP)
if err != nil {
return nil, err
}
e.address = address
e.config.Datastore.Endpoint = endpoint
e.config.Datastore.Config.CAFile = e.runtime.ETCDServerCA
e.config.Datastore.Config.CertFile = e.runtime.ClientETCDCert
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment