From e1a0b52fe78564eeb056ea003fdc393a394f56a3 Mon Sep 17 00:00:00 2001 From: Tommy Xiao Date: Tue, 22 Oct 2024 16:02:32 +0800 Subject: [PATCH] fix: update daemons --- pkg/cli/cmds/agent.go | 1 - pkg/cli/cmds/server.go | 7 ------- pkg/daemons/config/types.go | 1 - pkg/daemons/control/server.go | 16 +++++----------- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/pkg/cli/cmds/agent.go b/pkg/cli/cmds/agent.go index f798f230..3ac11314 100644 --- a/pkg/cli/cmds/agent.go +++ b/pkg/cli/cmds/agent.go @@ -15,7 +15,6 @@ type Agent struct { ServerURL string APIAddressCh chan []string DisableLoadBalancer bool - DisableServiceLB bool ETCDAgent bool LBServerPort int ResolvConf string diff --git a/pkg/cli/cmds/server.go b/pkg/cli/cmds/server.go index b551f40d..208a79d7 100644 --- a/pkg/cli/cmds/server.go +++ b/pkg/cli/cmds/server.go @@ -104,7 +104,6 @@ type Server struct { EtcdS3ConfigSecret string EtcdS3Timeout time.Duration EtcdS3Insecure bool - ServiceLBNamespace string } var ( @@ -216,12 +215,6 @@ var ServerFlags = []cli.Flag{ Destination: &ServerConfig.EgressSelectorMode, Value: "agent", }, - &cli.StringFlag{ - Name: "servicelb-namespace", - Usage: "(networking) Namespace of the pods for the servicelb component", - Destination: &ServerConfig.ServiceLBNamespace, - Value: "kube-system", - }, &cli.StringFlag{ Name: "write-kubeconfig,o", Usage: "(client) Write kubeconfig for admin client to this file", diff --git a/pkg/daemons/config/types.go b/pkg/daemons/config/types.go index b66328bc..b7366c5c 100644 --- a/pkg/daemons/config/types.go +++ b/pkg/daemons/config/types.go @@ -188,7 +188,6 @@ type Control struct { DisableETCD bool DisableScheduler bool Rootless bool - ServiceLBNamespace string ExtraAPIArgs []string ExtraControllerArgs []string ExtraCloudControllerArgs []string diff --git a/pkg/daemons/control/server.go b/pkg/daemons/control/server.go index 08742b32..e396e689 100644 --- a/pkg/daemons/control/server.go +++ b/pkg/daemons/control/server.go @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/xiaods/k8e/pkg/authenticator" "github.com/xiaods/k8e/pkg/cluster" "github.com/xiaods/k8e/pkg/daemons/config" @@ -16,8 +18,6 @@ import ( "github.com/xiaods/k8e/pkg/daemons/executor" "github.com/xiaods/k8e/pkg/util" "github.com/xiaods/k8e/pkg/version" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" authorizationv1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logsapi "k8s.io/component-base/logs/api/v1" @@ -79,7 +79,7 @@ func Server(ctx context.Context, cfg *config.Control) error { } } - if !cfg.DisableCCM || !cfg.DisableServiceLB { + if !cfg.DisableCCM { if err := cloudControllerManager(ctx, cfg); err != nil { return err } @@ -199,11 +199,8 @@ func apiServer(ctx context.Context, cfg *config.Control) error { argsMap["kubelet-certificate-authority"] = runtime.ServerCA argsMap["kubelet-client-certificate"] = runtime.ClientKubeAPICert argsMap["kubelet-client-key"] = runtime.ClientKubeAPIKey - if cfg.FlannelExternalIP { - argsMap["kubelet-preferred-address-types"] = "ExternalIP,InternalIP,Hostname" - } else { - argsMap["kubelet-preferred-address-types"] = "InternalIP,ExternalIP,Hostname" - } + argsMap["kubelet-preferred-address-types"] = "InternalIP,ExternalIP,Hostname" + argsMap["requestheader-client-ca-file"] = runtime.RequestHeaderCA argsMap["requestheader-allowed-names"] = deps.RequestHeaderCN argsMap["proxy-client-cert-file"] = runtime.ClientAuthProxyCert @@ -332,9 +329,6 @@ func cloudControllerManager(ctx context.Context, cfg *config.Control) error { argsMap["controllers"] = argsMap["controllers"] + ",-cloud-node,-cloud-node-lifecycle" argsMap["secure-port"] = "0" } - if cfg.DisableServiceLB { - argsMap["controllers"] = argsMap["controllers"] + ",-service" - } if cfg.VLevel != 0 { argsMap["v"] = strconv.Itoa(cfg.VLevel) }