mirror of https://github.com/k3s-io/k3s
commit
523ccaf3f2
|
@ -130,7 +130,9 @@ func run(app *cli.Context, cfg *cmds.Server) error {
|
||||||
if cmds.AgentConfig.FlannelIface != "" && cmds.AgentConfig.NodeIP == "" {
|
if cmds.AgentConfig.FlannelIface != "" && cmds.AgentConfig.NodeIP == "" {
|
||||||
cmds.AgentConfig.NodeIP = netutil.GetIPFromInterface(cmds.AgentConfig.FlannelIface)
|
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 != "" {
|
if serverConfig.ControlConfig.AdvertiseIP == "" && cmds.AgentConfig.NodeExternalIP != "" {
|
||||||
serverConfig.ControlConfig.AdvertiseIP = cmds.AgentConfig.NodeExternalIP
|
serverConfig.ControlConfig.AdvertiseIP = cmds.AgentConfig.NodeExternalIP
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,8 +137,8 @@ type Control struct {
|
||||||
|
|
||||||
BindAddress string
|
BindAddress string
|
||||||
SANs []string
|
SANs []string
|
||||||
|
PrivateIP string
|
||||||
Runtime *ControlRuntime `json:"-"`
|
Runtime *ControlRuntime `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ControlRuntimeBootstrap struct {
|
type ControlRuntimeBootstrap struct {
|
||||||
|
|
|
@ -309,12 +309,11 @@ func (e *ETCD) Register(ctx context.Context, config *config.Control, handler htt
|
||||||
}
|
}
|
||||||
e.client = client
|
e.client = client
|
||||||
|
|
||||||
address, err := getAdvertiseAddress(config.AdvertiseIP)
|
address, err := getAdvertiseAddress(config.PrivateIP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
e.address = address
|
e.address = address
|
||||||
|
|
||||||
e.config.Datastore.Endpoint = endpoint
|
e.config.Datastore.Endpoint = endpoint
|
||||||
e.config.Datastore.Config.CAFile = e.runtime.ETCDServerCA
|
e.config.Datastore.Config.CAFile = e.runtime.ETCDServerCA
|
||||||
e.config.Datastore.Config.CertFile = e.runtime.ClientETCDCert
|
e.config.Datastore.Config.CertFile = e.runtime.ClientETCDCert
|
||||||
|
|
Loading…
Reference in New Issue