Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f8a4547b
Commit
f8a4547b
authored
Oct 29, 2020
by
Menna Elmasry
Committed by
Brad Davidson
Oct 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #2448 from MonzElmasry/new_b
Make etcd use node private ip
parent
18e81842
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
server.go
pkg/cli/server/server.go
+3
-1
types.go
pkg/daemons/config/types.go
+2
-2
etcd.go
pkg/etcd/etcd.go
+1
-2
No files found.
pkg/cli/server/server.go
View file @
f8a4547b
...
@@ -130,7 +130,9 @@ func run(app *cli.Context, cfg *cmds.Server) error {
...
@@ -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
}
}
...
...
pkg/daemons/config/types.go
View file @
f8a4547b
...
@@ -137,8 +137,8 @@ type Control struct {
...
@@ -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
{
...
...
pkg/etcd/etcd.go
View file @
f8a4547b
...
@@ -309,12 +309,11 @@ func (e *ETCD) Register(ctx context.Context, config *config.Control, handler htt
...
@@ -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
.
Advertis
eIP
)
address
,
err
:=
getAdvertiseAddress
(
config
.
Privat
eIP
)
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment