diff --git a/pkg/kubenest/controller/endpoints.sync.controller/konnectivity_sync_controller.go b/pkg/kubenest/controller/endpoints.sync.controller/konnectivity_sync_controller.go index 52e8277e1..bd133fe47 100644 --- a/pkg/kubenest/controller/endpoints.sync.controller/konnectivity_sync_controller.go +++ b/pkg/kubenest/controller/endpoints.sync.controller/konnectivity_sync_controller.go @@ -73,7 +73,7 @@ func (e *KonnectivityController) SyncVirtualClusterEPS(ctx context.Context, k8sC return fmt.Errorf("eps %s has no subsets", eps.Name) } - // only sync the port of the konnectivity-server endpoints + // only sync the address of the konnectivity-server endpoints targetPort := virtualEndPoints.Subsets[0].Ports[0].Port updateEPS := virtualEndPoints.DeepCopy() @@ -124,6 +124,10 @@ func (e *KonnectivityController) Reconcile(ctx context.Context, request reconcil return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil } + if targetVirtualCluster.Spec.KubeInKubeConfig != nil && targetVirtualCluster.Spec.KubeInKubeConfig.APIServerServiceType == v1alpha1.NodePort { + return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil + } + k8sClient, err := util.GenerateKubeclient(targetVirtualCluster) if err != nil { klog.Errorf("virtualcluster %s crd kubernetes client failed: %v", targetVirtualCluster.Name, err)