diff --git a/cloud/services/container/nodepools/reconcile.go b/cloud/services/container/nodepools/reconcile.go index a643ac0ec..6350589b3 100644 --- a/cloud/services/container/nodepools/reconcile.go +++ b/cloud/services/container/nodepools/reconcile.go @@ -370,7 +370,7 @@ func (s *Service) checkDiffAndPrepareUpdateConfig(existingNodePool *containerpb. } } // Kubernetes taints - if !cmp.Equal(desiredNodePool.GetConfig().GetTaints(), existingNodePool.GetConfig().GetTaints()) { + if !cmp.Equal(desiredNodePool.GetConfig().GetTaints(), existingNodePool.GetConfig().GetTaints(), cmpopts.IgnoreUnexported(containerpb.NodeTaint{})) { needUpdate = true updateNodePoolRequest.Taints = &containerpb.NodeTaints{ Taints: desiredNodePool.GetConfig().GetTaints(), diff --git a/test/e2e/config/gcp-ci.yaml b/test/e2e/config/gcp-ci.yaml index 23057345e..b9a17e925 100644 --- a/test/e2e/config/gcp-ci.yaml +++ b/test/e2e/config/gcp-ci.yaml @@ -105,6 +105,8 @@ variables: EXP_MACHINE_POOL: "true" GKE_MACHINE_POOL_MIN: "1" GKE_MACHINE_POOL_MAX: "2" + GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY: "0" + GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY: "1" CAPG_LOGLEVEL: "4" intervals: diff --git a/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml b/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml index 72c9d4108..e1e40c160 100644 --- a/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml +++ b/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml @@ -61,4 +61,33 @@ spec: scaling: minCount: ${GKE_MACHINE_POOL_MIN} maxCount: ${GKE_MACHINE_POOL_MAX} - +--- +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: ${CLUSTER_NAME}-critical-addons-only +spec: + clusterName: ${CLUSTER_NAME} + replicas: ${WORKER_MACHINE_COUNT} + template: + spec: + bootstrap: + dataSecretName: "" + clusterName: ${CLUSTER_NAME} + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: GCPManagedMachinePool + name: ${CLUSTER_NAME}-critical-addons-only +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: GCPManagedMachinePool +metadata: + name: ${CLUSTER_NAME}-critical-addons-only +spec: + scaling: + minCount: ${GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY} + maxCount: ${GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY} + kubernetesTaints: + - effect: NoSchedule + key: CriticalAddonsOnly + value: "true" diff --git a/test/e2e/e2e_gke_test.go b/test/e2e/e2e_gke_test.go index 78e6ec53e..35496769e 100644 --- a/test/e2e/e2e_gke_test.go +++ b/test/e2e/e2e_gke_test.go @@ -92,6 +92,10 @@ var _ = Describe("GKE workload cluster creation", func() { Expect(ok).To(BeTrue(), "must have min pool size set via the GKE_MACHINE_POOL_MIN variable") maxPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MAX"] Expect(ok).To(BeTrue(), "must have max pool size set via the GKE_MACHINE_POOL_MAX variable") + minCriticalAddonsOnlyPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY"] + Expect(ok).To(BeTrue(), "must have min critical addons only pool size set via the GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY variable") + maxCriticalAddonsOnlyPoolSize, ok := e2eConfig.Variables["GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY"] + Expect(ok).To(BeTrue(), "must have max critical addons only pool size set via the GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY variable") ApplyManagedClusterTemplateAndWait(ctx, ApplyManagedClusterTemplateAndWaitInput{ ClusterProxy: bootstrapClusterProxy, @@ -107,8 +111,10 @@ var _ = Describe("GKE workload cluster creation", func() { ControlPlaneMachineCount: ptr.To[int64](1), WorkerMachineCount: ptr.To[int64](3), ClusterctlVariables: map[string]string{ - "GKE_MACHINE_POOL_MIN": minPoolSize, - "GKE_MACHINE_POOL_MAX": maxPoolSize, + "GKE_MACHINE_POOL_MIN": minPoolSize, + "GKE_MACHINE_POOL_MAX": maxPoolSize, + "GKE_MACHINE_POOL_MIN_CRITICAL_ADDONS_ONLY": minCriticalAddonsOnlyPoolSize, + "GKE_MACHINE_POOL_MAX_CRITICAL_ADDONS_ONLY": maxCriticalAddonsOnlyPoolSize, }, }, WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),