Disable configure-cloud-routes and external service/route programming support when using k3s stub cloud controller

Resolves warning 3 from #2471

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2020-11-03 09:27:56 -08:00 committed by Brad Davidson
parent 31575e407a
commit f50e3140f9

View File

@ -139,6 +139,7 @@ func controllerManager(cfg *config.Control, runtime *config.ControlRuntime) erro
"address": localhostIP.String(), "address": localhostIP.String(),
"bind-address": localhostIP.String(), "bind-address": localhostIP.String(),
"secure-port": "0", "secure-port": "0",
"cloud-provider": version.Program,
"use-service-account-credentials": "true", "use-service-account-credentials": "true",
"cluster-signing-cert-file": runtime.ClientCA, "cluster-signing-cert-file": runtime.ClientCA,
"cluster-signing-key-file": runtime.ClientCAKey, "cluster-signing-key-file": runtime.ClientCAKey,
@ -146,6 +147,10 @@ func controllerManager(cfg *config.Control, runtime *config.ControlRuntime) erro
if cfg.NoLeaderElect { if cfg.NoLeaderElect {
argsMap["leader-elect"] = "false" argsMap["leader-elect"] = "false"
} }
if !cfg.DisableCCM {
argsMap["configure-cloud-routes"] = "false"
argsMap["controllers"] = "*,-service,-route"
}
args := config.GetArgsList(argsMap, cfg.ExtraControllerArgs) args := config.GetArgsList(argsMap, cfg.ExtraControllerArgs)
logrus.Infof("Running kube-controller-manager %s", config.ArgString(args)) logrus.Infof("Running kube-controller-manager %s", config.ArgString(args))
@ -909,6 +914,8 @@ func cloudControllerManager(ctx context.Context, cfg *config.Control, runtime *c
argsMap := map[string]string{ argsMap := map[string]string{
"kubeconfig": runtime.KubeConfigCloudController, "kubeconfig": runtime.KubeConfigCloudController,
"allocate-node-cidrs": "true", "allocate-node-cidrs": "true",
"configure-cloud-routes": "false",
"controllers": "*,-service,-route",
"cluster-cidr": cfg.ClusterIPRange.String(), "cluster-cidr": cfg.ClusterIPRange.String(),
"bind-address": localhostIP.String(), "bind-address": localhostIP.String(),
"secure-port": "0", "secure-port": "0",