mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-28 21:39:36 +00:00
Merge pull request #2448 from MonzElmasry/new_b
Make etcd use node private ip
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user