Merge pull request #3214 from yuswift/feature/support_configurable_cluster_resync_perioud

Configurable cluster resync perioud
This commit is contained in:
KubeSphere CI Bot
2021-01-25 14:04:42 +08:00
committed by GitHub
4 changed files with 34 additions and 22 deletions

View File

@@ -48,6 +48,7 @@ import (
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"kubesphere.io/kubesphere/pkg/simple/client/k8s"
ldapclient "kubesphere.io/kubesphere/pkg/simple/client/ldap"
"kubesphere.io/kubesphere/pkg/simple/client/multicluster"
"kubesphere.io/kubesphere/pkg/simple/client/network"
ippoolclient "kubesphere.io/kubesphere/pkg/simple/client/network/ippool"
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
@@ -66,7 +67,7 @@ func addControllers(
options *k8s.KubernetesOptions,
authenticationOptions *authoptions.AuthenticationOptions,
openpitrixClient openpitrix.Client,
multiClusterEnabled bool,
multiClusterOptions *multicluster.Options,
networkOptions *network.Options,
serviceMeshEnabled bool,
kubectlImage string,
@@ -76,6 +77,8 @@ func addControllers(
istioInformer := informerFactory.IstioSharedInformerFactory()
kubesphereInformer := informerFactory.KubeSphereSharedInformerFactory()
multiClusterEnabled := multiClusterOptions.Enable
var vsController, drController manager.Runnable
if serviceMeshEnabled {
vsController = virtualservice.NewVirtualServiceController(kubernetesInformer.Core().V1().Services(),
@@ -229,7 +232,8 @@ func addControllers(
client.Config(),
kubesphereInformer.Cluster().V1alpha1().Clusters(),
client.KubeSphere().ClusterV1alpha1().Clusters(),
openpitrixClient)
openpitrixClient,
multiClusterOptions.ClusterControllerResyncSecond)
}
var nsnpController manager.Runnable

View File

@@ -251,7 +251,7 @@ func run(s *options.KubeSphereControllerManagerOptions, stopCh <-chan struct{})
s.KubernetesOptions,
s.AuthenticationOptions,
openpitrixClient,
s.MultiClusterOptions.Enable,
s.MultiClusterOptions,
s.NetworkOptions,
servicemeshEnabled,
s.AuthenticationOptions.KubectlImage, stopCh); err != nil {