mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Move DisableServiceLB/Rootless/ServiceLBNamespace into config.Control
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
063039471c
commit
a15e7e8b68
@ -114,8 +114,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
||||
serverConfig.ControlConfig.DataDir = cfg.DataDir
|
||||
serverConfig.ControlConfig.KubeConfigOutput = cfg.KubeConfigOutput
|
||||
serverConfig.ControlConfig.KubeConfigMode = cfg.KubeConfigMode
|
||||
serverConfig.Rootless = cfg.Rootless
|
||||
serverConfig.ServiceLBNamespace = cfg.ServiceLBNamespace
|
||||
serverConfig.ControlConfig.Rootless = cfg.Rootless
|
||||
serverConfig.ControlConfig.ServiceLBNamespace = cfg.ServiceLBNamespace
|
||||
serverConfig.ControlConfig.SANs = cfg.TLSSan
|
||||
serverConfig.ControlConfig.BindAddress = cfg.BindAddress
|
||||
serverConfig.ControlConfig.SupervisorPort = cfg.SupervisorPort
|
||||
@ -359,7 +359,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
||||
}
|
||||
}
|
||||
if serverConfig.ControlConfig.Skips["servicelb"] {
|
||||
serverConfig.DisableServiceLB = true
|
||||
serverConfig.ControlConfig.DisableServiceLB = true
|
||||
}
|
||||
|
||||
if serverConfig.ControlConfig.DisableCCM {
|
||||
@ -479,7 +479,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
||||
agentConfig.ServerURL = url
|
||||
agentConfig.Token = token
|
||||
agentConfig.DisableLoadBalancer = !serverConfig.ControlConfig.DisableAPIServer
|
||||
agentConfig.DisableServiceLB = serverConfig.DisableServiceLB
|
||||
agentConfig.DisableServiceLB = serverConfig.ControlConfig.DisableServiceLB
|
||||
agentConfig.ETCDAgent = serverConfig.ControlConfig.DisableAPIServer
|
||||
agentConfig.ClusterReset = serverConfig.ControlConfig.ClusterReset
|
||||
agentConfig.Rootless = cfg.Rootless
|
||||
|
@ -175,6 +175,9 @@ type Control struct {
|
||||
DisableETCD bool
|
||||
DisableKubeProxy bool
|
||||
DisableScheduler bool
|
||||
DisableServiceLB bool
|
||||
Rootless bool
|
||||
ServiceLBNamespace string
|
||||
EnablePProf bool
|
||||
ExtraAPIArgs []string
|
||||
ExtraControllerArgs []string
|
||||
|
@ -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) {
|
||||
// use same password file location that the agent creates
|
||||
nodePasswordRoot := "/"
|
||||
if config.Rootless {
|
||||
if config.ControlConfig.Rootless {
|
||||
nodePasswordRoot = filepath.Join(config.ControlConfig.DataDir, "agent")
|
||||
}
|
||||
nodeConfigPath := filepath.Join(nodePasswordRoot, "etc", "rancher", "node")
|
||||
|
@ -214,9 +214,9 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
|
||||
sc.Core.Core().V1().Pod(),
|
||||
sc.Core.Core().V1().Service(),
|
||||
sc.Core.Core().V1().Endpoints(),
|
||||
config.ServiceLBNamespace,
|
||||
!config.DisableServiceLB,
|
||||
config.Rootless); err != nil {
|
||||
config.ControlConfig.ServiceLBNamespace,
|
||||
!config.ControlConfig.DisableServiceLB,
|
||||
config.ControlConfig.Rootless); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -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,
|
||||
sc.Core.Core().V1().Service(),
|
||||
!config.DisableServiceLB,
|
||||
!config.ControlConfig.DisableServiceLB,
|
||||
config.ControlConfig.HTTPSPort)
|
||||
}
|
||||
|
||||
@ -378,7 +378,7 @@ func writeKubeConfig(certs string, config *Config) error {
|
||||
port = config.ControlConfig.APIServerPort
|
||||
}
|
||||
url := fmt.Sprintf("https://%s:%d", ip, port)
|
||||
kubeConfig, err := HomeKubeConfig(true, config.Rootless)
|
||||
kubeConfig, err := HomeKubeConfig(true, config.ControlConfig.Rootless)
|
||||
def := true
|
||||
if err != nil {
|
||||
kubeConfig = filepath.Join(config.ControlConfig.DataDir, "kubeconfig-"+version.Program+".yaml")
|
||||
|
@ -8,15 +8,12 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
DisableAgent bool
|
||||
DisableServiceLB bool
|
||||
ControlConfig config.Control
|
||||
Rootless bool
|
||||
ServiceLBNamespace string
|
||||
SupervisorPort int
|
||||
StartupHooks []cmds.StartupHook
|
||||
LeaderControllers CustomControllers
|
||||
Controllers CustomControllers
|
||||
DisableAgent bool
|
||||
ControlConfig config.Control
|
||||
SupervisorPort int
|
||||
StartupHooks []cmds.StartupHook
|
||||
LeaderControllers CustomControllers
|
||||
Controllers CustomControllers
|
||||
}
|
||||
|
||||
type CustomControllers []func(ctx context.Context, sc *Context) error
|
||||
|
Loading…
Reference in New Issue
Block a user