From 03af1c7272ddc46fdd5bdcfde2313fb57b8fa4d5 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Wed, 1 Mar 2023 09:23:15 -0500 Subject: [PATCH] gce: Don't reconcile routes when running with "gce" networking. If running with GCE "native" networking, we do not need the route controller (and it causes problems); we turn it off by setting --configure-cloud-routes=false. In general we do not need the gkenetworkparams controller (and it complains about missing CRDs). We will turn it off in future, but it isn't in the images we are using currently. --- .../components/gcpcloudcontrollermanager.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/model/components/gcpcloudcontrollermanager.go b/pkg/model/components/gcpcloudcontrollermanager.go index 10d284dfc2..c934eb35b9 100644 --- a/pkg/model/components/gcpcloudcontrollermanager.go +++ b/pkg/model/components/gcpcloudcontrollermanager.go @@ -57,6 +57,24 @@ func (b *GCPCloudControllerManagerOptionsBuilder) BuildOptions(options interface if ccmConfig.ClusterCIDR == "" { ccmConfig.ClusterCIDR = clusterSpec.Networking.PodCIDR } + + if clusterSpec.Networking.GCE != nil { + // "GCE" networking mode is called "ip-alias" or "vpc-native" on GKE. + // We don't need to configure routes if we are using "real" IPs. + ccmConfig.ConfigureCloudRoutes = fi.PtrTo(false) + } + + if ccmConfig.Controllers == nil { + ccmConfig.Controllers = []string{ + "*", + + // Don't run gkenetworkparamset controller, looks for some CRDs (GKENetworkParamSet and Network) which are only installed on GKE + // However, the version we're current running doesn't support this controller anyway, so we need to introduce this later, + // possibly based on the image version. + // "-gkenetworkparams", + } + } + if ccmConfig.Image == "" { // TODO: Implement CCM image publishing switch b.KubernetesVersion.Minor {