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
a15e7e8b
Commit
a15e7e8b
authored
Sep 29, 2022
by
Brad Davidson
Committed by
Brad Davidson
Sep 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move DisableServiceLB/Rootless/ServiceLBNamespace into config.Control
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
06303947
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
20 deletions
+20
-20
server.go
pkg/cli/server/server.go
+4
-4
types.go
pkg/daemons/config/types.go
+3
-0
router.go
pkg/server/router.go
+1
-1
server.go
pkg/server/server.go
+6
-6
types.go
pkg/server/types.go
+6
-9
No files found.
pkg/cli/server/server.go
View file @
a15e7e8b
...
@@ -114,8 +114,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
...
@@ -114,8 +114,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
serverConfig
.
ControlConfig
.
DataDir
=
cfg
.
DataDir
serverConfig
.
ControlConfig
.
DataDir
=
cfg
.
DataDir
serverConfig
.
ControlConfig
.
KubeConfigOutput
=
cfg
.
KubeConfigOutput
serverConfig
.
ControlConfig
.
KubeConfigOutput
=
cfg
.
KubeConfigOutput
serverConfig
.
ControlConfig
.
KubeConfigMode
=
cfg
.
KubeConfigMode
serverConfig
.
ControlConfig
.
KubeConfigMode
=
cfg
.
KubeConfigMode
serverConfig
.
Rootless
=
cfg
.
Rootless
serverConfig
.
ControlConfig
.
Rootless
=
cfg
.
Rootless
serverConfig
.
ServiceLBNamespace
=
cfg
.
ServiceLBNamespace
serverConfig
.
ControlConfig
.
ServiceLBNamespace
=
cfg
.
ServiceLBNamespace
serverConfig
.
ControlConfig
.
SANs
=
cfg
.
TLSSan
serverConfig
.
ControlConfig
.
SANs
=
cfg
.
TLSSan
serverConfig
.
ControlConfig
.
BindAddress
=
cfg
.
BindAddress
serverConfig
.
ControlConfig
.
BindAddress
=
cfg
.
BindAddress
serverConfig
.
ControlConfig
.
SupervisorPort
=
cfg
.
SupervisorPort
serverConfig
.
ControlConfig
.
SupervisorPort
=
cfg
.
SupervisorPort
...
@@ -359,7 +359,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
...
@@ -359,7 +359,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
}
}
}
}
if
serverConfig
.
ControlConfig
.
Skips
[
"servicelb"
]
{
if
serverConfig
.
ControlConfig
.
Skips
[
"servicelb"
]
{
serverConfig
.
DisableServiceLB
=
true
serverConfig
.
ControlConfig
.
DisableServiceLB
=
true
}
}
if
serverConfig
.
ControlConfig
.
DisableCCM
{
if
serverConfig
.
ControlConfig
.
DisableCCM
{
...
@@ -479,7 +479,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
...
@@ -479,7 +479,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
agentConfig
.
ServerURL
=
url
agentConfig
.
ServerURL
=
url
agentConfig
.
Token
=
token
agentConfig
.
Token
=
token
agentConfig
.
DisableLoadBalancer
=
!
serverConfig
.
ControlConfig
.
DisableAPIServer
agentConfig
.
DisableLoadBalancer
=
!
serverConfig
.
ControlConfig
.
DisableAPIServer
agentConfig
.
DisableServiceLB
=
serverConfig
.
DisableServiceLB
agentConfig
.
DisableServiceLB
=
serverConfig
.
ControlConfig
.
DisableServiceLB
agentConfig
.
ETCDAgent
=
serverConfig
.
ControlConfig
.
DisableAPIServer
agentConfig
.
ETCDAgent
=
serverConfig
.
ControlConfig
.
DisableAPIServer
agentConfig
.
ClusterReset
=
serverConfig
.
ControlConfig
.
ClusterReset
agentConfig
.
ClusterReset
=
serverConfig
.
ControlConfig
.
ClusterReset
agentConfig
.
Rootless
=
cfg
.
Rootless
agentConfig
.
Rootless
=
cfg
.
Rootless
...
...
pkg/daemons/config/types.go
View file @
a15e7e8b
...
@@ -175,6 +175,9 @@ type Control struct {
...
@@ -175,6 +175,9 @@ type Control struct {
DisableETCD
bool
DisableETCD
bool
DisableKubeProxy
bool
DisableKubeProxy
bool
DisableScheduler
bool
DisableScheduler
bool
DisableServiceLB
bool
Rootless
bool
ServiceLBNamespace
string
EnablePProf
bool
EnablePProf
bool
ExtraAPIArgs
[]
string
ExtraAPIArgs
[]
string
ExtraControllerArgs
[]
string
ExtraControllerArgs
[]
string
...
...
pkg/server/router.go
View file @
a15e7e8b
...
@@ -436,7 +436,7 @@ func passwordBootstrap(ctx context.Context, config *Config) nodePassBootstrapper
...
@@ -436,7 +436,7 @@ func passwordBootstrap(ctx context.Context, config *Config) nodePassBootstrapper
func
verifyLocalPassword
(
ctx
context
.
Context
,
config
*
Config
,
mu
*
sync
.
Mutex
,
deferredNodes
map
[
string
]
bool
,
nodeName
,
nodePassword
string
)
(
string
,
int
,
error
)
{
func
verifyLocalPassword
(
ctx
context
.
Context
,
config
*
Config
,
mu
*
sync
.
Mutex
,
deferredNodes
map
[
string
]
bool
,
nodeName
,
nodePassword
string
)
(
string
,
int
,
error
)
{
// use same password file location that the agent creates
// use same password file location that the agent creates
nodePasswordRoot
:=
"/"
nodePasswordRoot
:=
"/"
if
config
.
Rootless
{
if
config
.
ControlConfig
.
Rootless
{
nodePasswordRoot
=
filepath
.
Join
(
config
.
ControlConfig
.
DataDir
,
"agent"
)
nodePasswordRoot
=
filepath
.
Join
(
config
.
ControlConfig
.
DataDir
,
"agent"
)
}
}
nodeConfigPath
:=
filepath
.
Join
(
nodePasswordRoot
,
"etc"
,
"rancher"
,
"node"
)
nodeConfigPath
:=
filepath
.
Join
(
nodePasswordRoot
,
"etc"
,
"rancher"
,
"node"
)
...
...
pkg/server/server.go
View file @
a15e7e8b
...
@@ -214,9 +214,9 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
...
@@ -214,9 +214,9 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
sc
.
Core
.
Core
()
.
V1
()
.
Pod
(),
sc
.
Core
.
Core
()
.
V1
()
.
Pod
(),
sc
.
Core
.
Core
()
.
V1
()
.
Service
(),
sc
.
Core
.
Core
()
.
V1
()
.
Service
(),
sc
.
Core
.
Core
()
.
V1
()
.
Endpoints
(),
sc
.
Core
.
Core
()
.
V1
()
.
Endpoints
(),
config
.
ServiceLBNamespace
,
config
.
ControlConfig
.
ServiceLBNamespace
,
!
config
.
DisableServiceLB
,
!
config
.
ControlConfig
.
DisableServiceLB
,
config
.
Rootless
);
err
!=
nil
{
config
.
ControlConfig
.
Rootless
);
err
!=
nil
{
return
err
return
err
}
}
...
@@ -230,10 +230,10 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
...
@@ -230,10 +230,10 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
}
}
}
}
if
config
.
Rootless
{
if
config
.
ControlConfig
.
Rootless
{
return
rootlessports
.
Register
(
ctx
,
return
rootlessports
.
Register
(
ctx
,
sc
.
Core
.
Core
()
.
V1
()
.
Service
(),
sc
.
Core
.
Core
()
.
V1
()
.
Service
(),
!
config
.
DisableServiceLB
,
!
config
.
ControlConfig
.
DisableServiceLB
,
config
.
ControlConfig
.
HTTPSPort
)
config
.
ControlConfig
.
HTTPSPort
)
}
}
...
@@ -378,7 +378,7 @@ func writeKubeConfig(certs string, config *Config) error {
...
@@ -378,7 +378,7 @@ func writeKubeConfig(certs string, config *Config) error {
port
=
config
.
ControlConfig
.
APIServerPort
port
=
config
.
ControlConfig
.
APIServerPort
}
}
url
:=
fmt
.
Sprintf
(
"https://%s:%d"
,
ip
,
port
)
url
:=
fmt
.
Sprintf
(
"https://%s:%d"
,
ip
,
port
)
kubeConfig
,
err
:=
HomeKubeConfig
(
true
,
config
.
Rootless
)
kubeConfig
,
err
:=
HomeKubeConfig
(
true
,
config
.
ControlConfig
.
Rootless
)
def
:=
true
def
:=
true
if
err
!=
nil
{
if
err
!=
nil
{
kubeConfig
=
filepath
.
Join
(
config
.
ControlConfig
.
DataDir
,
"kubeconfig-"
+
version
.
Program
+
".yaml"
)
kubeConfig
=
filepath
.
Join
(
config
.
ControlConfig
.
DataDir
,
"kubeconfig-"
+
version
.
Program
+
".yaml"
)
...
...
pkg/server/types.go
View file @
a15e7e8b
...
@@ -8,15 +8,12 @@ import (
...
@@ -8,15 +8,12 @@ import (
)
)
type
Config
struct
{
type
Config
struct
{
DisableAgent
bool
DisableAgent
bool
DisableServiceLB
bool
ControlConfig
config
.
Control
ControlConfig
config
.
Control
SupervisorPort
int
Rootless
bool
StartupHooks
[]
cmds
.
StartupHook
ServiceLBNamespace
string
LeaderControllers
CustomControllers
SupervisorPort
int
Controllers
CustomControllers
StartupHooks
[]
cmds
.
StartupHook
LeaderControllers
CustomControllers
Controllers
CustomControllers
}
}
type
CustomControllers
[]
func
(
ctx
context
.
Context
,
sc
*
Context
)
error
type
CustomControllers
[]
func
(
ctx
context
.
Context
,
sc
*
Context
)
error
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