feature(sync): Implement syncing across replicas in a Deployment,ReplicaSet,StatefulSet#3189
Open
atidyshirt wants to merge 3 commits intodevspace-sh:mainfrom
Open
feature(sync): Implement syncing across replicas in a Deployment,ReplicaSet,StatefulSet#3189atidyshirt wants to merge 3 commits intodevspace-sh:mainfrom
atidyshirt wants to merge 3 commits intodevspace-sh:mainfrom
Conversation
Implements multi-replica sync as discussed in devspace-sh#1250 Sync all pods in the selected Deployment, with additional replicas upload-only and OnUpload cleared on those targets to avoid feedback loops. Existing sync flags remain respected where applicable; the intentional exception is that non-primary replicas are not full bidirectional sync (no download / downstream parity with the primary). Changes/Details: - Add dev.sync[*].syncReplicas and cmd/sync --sync-replicas * (pick disabled when the flag is set). - Target expansion uses pod owner refs to resolve the Deployment and list matching pods; primary is the newest pod. - Secondaries never download; drift from the primary on those pods must be corrected by changing files locally so they upload again.
Split out target selection into a separate file and add some test cases to show the behaviour of the target selection.
✅ Deploy Preview for devspace-docs canceled.Built without sensitive environment variables
|
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.
What issue type does this pull request address? (keep at least one, remove the others)
/kind feature
/kind enhancement
/kind test
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>if possible)resolves #1250 (Closed issue, but I can create a separate issue detailing use-cases where this is useful)
Please provide a short message that should be published in the DevSpace release notes
Support multi-pod sync over Kubernetes deployments (ReplicaSet, Deployments, StatefulSet)
What else do we need to know?
syncReplicas: booleanin config and/or--sync-replicason dev syncsyncReplicas: truesync-replicastestdataNote from me
The goal of this change is to make dev pipeline options (image, command, and the rest) not mutually exclusive with syncing multiple replicas—something that today is only achievable via bespoke bash scripting outside of Devspace.
I am fairly new to Go, so feedback on style and structure is very welcome. If this PR does not align with the goals of the application, feel free to drop it entirely.
Thanks