Make apiserver egress args conditional on egress-selector-mode

Only configure enable-aggregator-routing and egress-selector-config-file
if required by egress-selector-mode.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit f21ae1d949)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/8169/head
Brad Davidson 2023-07-13 23:33:37 +00:00 committed by Brad Davidson
parent 739141a79b
commit 4c6f7bfb08
1 changed files with 4 additions and 2 deletions

View File

@ -174,8 +174,10 @@ func apiServer(ctx context.Context, cfg *config.Control) error {
} else {
argsMap["bind-address"] = cfg.APIServerBindAddress
}
if cfg.EgressSelectorMode != config.EgressSelectorModeDisabled {
argsMap["enable-aggregator-routing"] = "true"
argsMap["egress-selector-config-file"] = runtime.EgressSelectorConfig
}
argsMap["tls-cert-file"] = runtime.ServingKubeAPICert
argsMap["tls-private-key-file"] = runtime.ServingKubeAPIKey
argsMap["service-account-key-file"] = runtime.ServiceKey