Skip to content

Commit

Permalink
add MultiClusterService featuregate
Browse files Browse the repository at this point in the history
Signed-off-by: changzhen <[email protected]>
  • Loading branch information
XiShanYongYe-Chang committed Nov 30, 2023
1 parent 68d937e commit 53252a3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion artifacts/agent/karmada-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- --cluster-status-update-frequency=10s
- --bind-address=0.0.0.0
- --secure-port=10357
- --feature-gates=CustomizedClusterResourceModeling=true
- --feature-gates=CustomizedClusterResourceModeling=true,MultiClusterService=true
- --v=4
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion artifacts/deploy/karmada-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- --secure-port=10357
- --failover-eviction-timeout=30s
- --controllers=*,hpaReplicasSyncer
- --feature-gates=PropagationPolicyPreemption=true
- --feature-gates=PropagationPolicyPreemption=true,MultiClusterService=true
- --v=4
livenessProbe:
httpGet:
Expand Down
5 changes: 4 additions & 1 deletion cmd/agent/app/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
"github.com/karmada-io/karmada/pkg/controllers/mcs"
"github.com/karmada-io/karmada/pkg/controllers/multiclusterservice"
"github.com/karmada-io/karmada/pkg/controllers/status"
"github.com/karmada-io/karmada/pkg/features"
karmadaclientset "github.com/karmada-io/karmada/pkg/generated/clientset/versioned"
"github.com/karmada-io/karmada/pkg/karmadactl/util/apiclient"
"github.com/karmada-io/karmada/pkg/metrics"
Expand Down Expand Up @@ -128,7 +129,9 @@ func init() {
controllers["workStatus"] = startWorkStatusController
controllers["serviceExport"] = startServiceExportController
controllers["certRotation"] = startCertRotationController
controllers["endpointsliceCollect"] = startEndpointSliceCollectController
if features.FeatureGate.Enabled(features.MultiClusterService) {
controllers["endpointsliceCollect"] = startEndpointSliceCollectController
}
}

func run(ctx context.Context, opts *options.Options) error {
Expand Down
8 changes: 5 additions & 3 deletions cmd/controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ func init() {
controllers["federatedHorizontalPodAutoscaler"] = startFederatedHorizontalPodAutoscalerController
controllers["cronFederatedHorizontalPodAutoscaler"] = startCronFederatedHorizontalPodAutoscalerController
controllers["hpaReplicasSyncer"] = startHPAReplicasSyncerController
controllers["multiclusterservice"] = startMCSController
controllers["endpointsliceCollect"] = startEndpointSliceCollectController
controllers["endpointsliceDispatch"] = startEndpointSliceDispatchController
if features.FeatureGate.Enabled(features.MultiClusterService) {
controllers["multiclusterservice"] = startMCSController
controllers["endpointsliceCollect"] = startEndpointSliceCollectController
controllers["endpointsliceDispatch"] = startEndpointSliceDispatchController
}
}

func startClusterController(ctx controllerscontext.Context) (enabled bool, err error) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const (

// PolicyPreemption indicates if high-priority PropagationPolicy/ClusterPropagationPolicy could preempt resource templates which are matched by low-priority PropagationPolicy/ClusterPropagationPolicy.
PolicyPreemption featuregate.Feature = "PropagationPolicyPreemption"

// MultiClusterService indicates if enable multi-cluster service function.
MultiClusterService featuregate.Feature = "MultiClusterService"
)

var (
Expand All @@ -50,6 +53,7 @@ var (
PropagateDeps: {Default: true, PreRelease: featuregate.Beta},
CustomizedClusterResourceModeling: {Default: true, PreRelease: featuregate.Beta},
PolicyPreemption: {Default: false, PreRelease: featuregate.Alpha},
MultiClusterService: {Default: false, PreRelease: featuregate.Alpha},
}
)

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/mcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ func checkEndpointSliceSynced(provisionEPSList, consumptionEPSList *discoveryv1.

synced := false
for _, item := range provisionEPSList.Items {
if item.GetLabels()[discoveryv1.LabelManagedBy] == util.EndpointSliceControllerLabelValue {
if item.GetLabels()[discoveryv1.LabelManagedBy] == util.EndpointSliceDispatchControllerLabelValue {
continue
}
for _, consumptionItem := range consumptionEPSList.Items {
Expand Down

0 comments on commit 53252a3

Please sign in to comment.