mirror of https://github.com/k3s-io/k3s
Merge pull request #1695 from ibuildthecloud/kubeproxy
Add ability to disable kubeproxypull/1752/head
commit
c941e1d0bb
|
@ -474,6 +474,7 @@ func get(envInfo *cmds.Agent) (*config.Node, error) {
|
||||||
nodeConfig.AgentConfig.PrivateRegistry = envInfo.PrivateRegistry
|
nodeConfig.AgentConfig.PrivateRegistry = envInfo.PrivateRegistry
|
||||||
nodeConfig.AgentConfig.DisableCCM = controlConfig.DisableCCM
|
nodeConfig.AgentConfig.DisableCCM = controlConfig.DisableCCM
|
||||||
nodeConfig.AgentConfig.DisableNPC = controlConfig.DisableNPC
|
nodeConfig.AgentConfig.DisableNPC = controlConfig.DisableNPC
|
||||||
|
nodeConfig.AgentConfig.DisableKubeProxy = controlConfig.DisableKubeProxy
|
||||||
nodeConfig.AgentConfig.Rootless = envInfo.Rootless
|
nodeConfig.AgentConfig.Rootless = envInfo.Rootless
|
||||||
nodeConfig.DisableSELinux = envInfo.DisableSELinux
|
nodeConfig.DisableSELinux = envInfo.DisableSELinux
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ type Server struct {
|
||||||
DefaultLocalStoragePath string
|
DefaultLocalStoragePath string
|
||||||
DisableCCM bool
|
DisableCCM bool
|
||||||
DisableNPC bool
|
DisableNPC bool
|
||||||
|
DisableKubeProxy bool
|
||||||
ClusterInit bool
|
ClusterInit bool
|
||||||
ClusterReset bool
|
ClusterReset bool
|
||||||
EncryptSecrets bool
|
EncryptSecrets bool
|
||||||
|
@ -210,6 +211,11 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
|
||||||
Usage: "(components) Disable k3s default cloud controller manager",
|
Usage: "(components) Disable k3s default cloud controller manager",
|
||||||
Destination: &ServerConfig.DisableCCM,
|
Destination: &ServerConfig.DisableCCM,
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "disable-kube-proxy",
|
||||||
|
Usage: "(components) Disable running kube-proxy",
|
||||||
|
Destination: &ServerConfig.DisableKubeProxy,
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "disable-network-policy",
|
Name: "disable-network-policy",
|
||||||
Usage: "(components) Disable k3s default network policy controller",
|
Usage: "(components) Disable k3s default network policy controller",
|
||||||
|
|
|
@ -98,6 +98,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {
|
||||||
serverConfig.ControlConfig.ExtraCloudControllerArgs = cfg.ExtraCloudControllerArgs
|
serverConfig.ControlConfig.ExtraCloudControllerArgs = cfg.ExtraCloudControllerArgs
|
||||||
serverConfig.ControlConfig.DisableCCM = cfg.DisableCCM
|
serverConfig.ControlConfig.DisableCCM = cfg.DisableCCM
|
||||||
serverConfig.ControlConfig.DisableNPC = cfg.DisableNPC
|
serverConfig.ControlConfig.DisableNPC = cfg.DisableNPC
|
||||||
|
serverConfig.ControlConfig.DisableKubeProxy = cfg.DisableKubeProxy
|
||||||
serverConfig.ControlConfig.ClusterInit = cfg.ClusterInit
|
serverConfig.ControlConfig.ClusterInit = cfg.ClusterInit
|
||||||
serverConfig.ControlConfig.ClusterReset = cfg.ClusterReset
|
serverConfig.ControlConfig.ClusterReset = cfg.ClusterReset
|
||||||
serverConfig.ControlConfig.EncryptSecrets = cfg.EncryptSecrets
|
serverConfig.ControlConfig.EncryptSecrets = cfg.EncryptSecrets
|
||||||
|
|
|
@ -29,12 +29,15 @@ func Agent(config *config.Agent) error {
|
||||||
defer logs.FlushLogs()
|
defer logs.FlushLogs()
|
||||||
|
|
||||||
startKubelet(config)
|
startKubelet(config)
|
||||||
startKubeProxy(config)
|
|
||||||
|
if !config.DisableKubeProxy {
|
||||||
|
return startKubeProxy(config)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func startKubeProxy(cfg *config.Agent) {
|
func startKubeProxy(cfg *config.Agent) error {
|
||||||
argsMap := map[string]string{
|
argsMap := map[string]string{
|
||||||
"proxy-mode": "iptables",
|
"proxy-mode": "iptables",
|
||||||
"healthz-bind-address": "127.0.0.1",
|
"healthz-bind-address": "127.0.0.1",
|
||||||
|
@ -53,6 +56,8 @@ func startKubeProxy(cfg *config.Agent) {
|
||||||
logrus.Infof("Running kube-proxy %s", config.ArgString(args))
|
logrus.Infof("Running kube-proxy %s", config.ArgString(args))
|
||||||
logrus.Fatalf("kube-proxy exited: %v", command.Execute())
|
logrus.Fatalf("kube-proxy exited: %v", command.Execute())
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func startKubelet(cfg *config.Agent) {
|
func startKubelet(cfg *config.Agent) {
|
||||||
|
|
|
@ -79,6 +79,7 @@ type Agent struct {
|
||||||
PrivateRegistry string
|
PrivateRegistry string
|
||||||
DisableCCM bool
|
DisableCCM bool
|
||||||
DisableNPC bool
|
DisableNPC bool
|
||||||
|
DisableKubeProxy bool
|
||||||
Rootless bool
|
Rootless bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +113,7 @@ type Control struct {
|
||||||
DefaultLocalStoragePath string
|
DefaultLocalStoragePath string
|
||||||
DisableCCM bool
|
DisableCCM bool
|
||||||
DisableNPC bool
|
DisableNPC bool
|
||||||
|
DisableKubeProxy bool
|
||||||
ClusterInit bool
|
ClusterInit bool
|
||||||
ClusterReset bool
|
ClusterReset bool
|
||||||
EncryptSecrets bool
|
EncryptSecrets bool
|
||||||
|
|
Loading…
Reference in New Issue