feat: multi-cluster replication and remote cleanup support#1883
Open
Amar-08 wants to merge 1 commit intofluxcd:mainfrom
Open
feat: multi-cluster replication and remote cleanup support#1883Amar-08 wants to merge 1 commit intofluxcd:mainfrom
Amar-08 wants to merge 1 commit intofluxcd:mainfrom
Conversation
Signed-off-by: Amarpreet Saluja <amarpreet.saluja@coindcx.com>
f1d064a to
7d4d0e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Multi-Cluster Replication and Remote Cleanup Support
Description
This PR introduces support for Istio resource replication across multiple clusters, specifically targeting Multi-Primary (Master-Master) Istio deployments. It enhances Flagger's ability to sync and clean up
VirtualServiceandDestinationRuleresources across remote Kubernetes clusters.Key Features
IstioRouternow maintains multiple clients and replicates routing changes to all discovered clusters simultaneously.Canaryfinalization phase. This overcomes the limitation of cross-clusterOwnerReferences.istio-injection: enabled) target namespaces on remote clusters if they are missing.Canarycontroller now enforces finalizers in multi-cluster mode regardless of therevertOnDeletionsetting to ensure a leak-free environment.Motivation
Standard Flagger is cluster-local, which makes it challenging to use in global service meshes where routing must be consistent across multiple independent control planes. This PR allows Flagger to act as a "Global Traffic Orchestrator" for Istio.
Technical Details
pkg/router/multi_cluster.gofor cluster discovery and client management.IstioRouterto useMultiClusterClient.finalizelogic inpkg/controller/finalizer.goto handle readiness checks more robustly during cleanup.--istio-multicluster-enabled--istio-multicluster-secret-label--istio-multicluster-secret-namespaceVerification Results
Unit Tests
A new test suite has been added to verify multi-cluster behaviors:
TestController_MultiClusterFinalizer: Verifies that finalizers are added/triggered and remote resources are cleaned up.TestClusterManager_ResolveNamespace: Verifies automated namespace creation and labeling.TestIstioRouter_ReplicateToRemote: Verifies concurrent replication to multiple clusters.Status: All tests passed (
go test -v ./pkg/controller/... ./pkg/router/...)Manual Verification
Tested on a live AWS EKS environment across multiple accounts using a private Flagger build. Verified that: