-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data mover micro service design #7576
Data mover micro service design #7576
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7576 +/- ##
==========================================
- Coverage 61.70% 58.79% -2.91%
==========================================
Files 263 345 +82
Lines 28861 28766 -95
==========================================
- Hits 17808 16914 -894
- Misses 9793 10423 +630
- Partials 1260 1429 +169 ☔ View full report in Codecov by Sentry. |
adc1979
to
2264d56
Compare
|
||
In order to have the same capability and permission with node-agent, below pod configurations are inherited from node-agent and set to backupPod/restorePod's spec: | ||
- Volumes: Some configMaps will be mapped as volumes to node-agent, so we add the same volumes of node-agent to the backupPod/restorePod | ||
- Environment Variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If time permits, we should follow the best practice to limit/minimize the scope and capability of the backupPod/restorePod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, theoretically, the backupPod/restorePod only needs to host the VGDP instance. And besides that, we also need a kube client so as to fulfill below communicating and controlling purposes:
- Watch some status of DUCR/DDCR for synchronization with the controller, i.e., ready for start VGDP; VGDP cancellation
- Deliver information to the controller, i.e., VGDP progress
There is no other functionalities in backupPod/restorePod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may open an issue to limit the scope of the roles of the backupPod/restorePod but it can be optional for phase 1 implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a clarification for the roles/privileges/capabilities of the backupPod/restorePod.
We can open an issue for further changes after this micro service feature is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this, but it feels like a perfect thing to at least think through how a third-party datamover could now plugin into this system.
The scope of this design is for VGDP, VGDP is a part of VBDM (Velero Build-in Data Mover), so this design doesn't cover 3rd data movers. I can add a clarification for this in the design. |
2264d56
to
3527da1
Compare
So my thought process was: We could use a generic controller to handle the DUCR/DDCR and then move all the data movers to micro services and have the generic controller be able to control what data mover is called when. The biggest problem with the design at the moment is that I can only have a single Data Mover. I have to copy the full VBDM code and extend it for my use case (a particular volume for a particular driver). Maybe this isn't how you want to solve that problem, and that is ok, but it is an option. I would like to see us think through a solution to this problem though. |
I think this is possible theoretically, though we still need to cover lots of details, e.g., how do we publish the communication mechanism so that 3rd data movers could implement. Anyway, this is out of the scope of the current design. I suggest to open another issue after this design is merged and we can continue this discussion in the issue. |
18f2382
to
4b8f92d
Compare
Is this design a candidate for v1.15? |
Yes |
|
||
We use two mechanism to make the watch: | ||
**Pod Phases**: VGDP Watcher watches the backupPod/restorePod's phases updated by Kubernetes. That is, VGDP Watcher creates an informer to watch the pod resource for the backupPod/restorePod and detect that the pod reaches to one of the terminated phases (i.e., PodSucceeded, PodFailed). We also check the availability & status of the backupPod/restorePod at the beginning of the watch so as to detect the starting of the backupPod/restorePod. | ||
**Custom Kubernetes Events**: VGDP-MS generates Kubernetes events and associates them to the DUCR/DDCR at the time of VGDP instance starting/stopping and progress update, then VGDP Watcher creates another informer to watch the Event resource associated to the DUCR/DDCR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sseago @shawn-hurley Any comments on this approach? Essentially we intend to use k8s events as a way for communication from the DM pod to node-agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we say events, we are suggesting to create events.k8s.io/v1
objects tied to the DUCR/DDCR.
I would worry about this from the watcher if it is taking actions based on the events from docs
Events should be treated as informative, best-effort, supplemental data.
Can VGDP-MS also update the status of the DDCR/DUCR? sorry if that is a silly question. Adding this to my queue to look at more closely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Events should be treated as informative, best-effort, supplemental data.
Yes, we are using events.k8s.io/v1
here by sticking to this principle. Specifically:
- Events never deliver decisive information. E.g., the state transitions, i.e., data mover starts/stops/cancelled/crashed, are done by monitoring backupPod/restorePod's status.
- Events are only used to deliver auxiliary information, i.e., logs for the operation of data movements, progress of the data movements, etc; events also hep to deliver the cross check information so that we know more what happened for troubleshooting of corner cases.
However, events are not unnecessary, as explained in the Dual mode event watch
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can VGDP-MS also update the status of the DDCR/DUCR?
We have excluded this option from the very beginning. This requires dedicate conflict (when updating DUCR/DDCR) resolution, which makes the data mover's workflow complicated and fragmented.
Therefore, here we follow another principle --- every update to the DDCR/DUCR must be done by the controllers.
39757fb
to
4fb4c95
Compare
This log redirecting mechanism is thread safe since the hook acquires the write lock before writing the log buffer, so it guarantees that in the node-agent log there is no corruptions after redirecting the log, and the redirected logs and the original node-agent logs are not projected into each other. | ||
|
||
## node-agent | ||
node-agent is still required. Even though VGDP is now not running inside node-agent, node-agent still hosts the data mover controller which reconciles DUCR/DDCR and operates DUCR/DDCR in other steps before the VGDP instance is started, i.e., Accept, Expose, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the current design, the reason DUCR/DDCR is reconciled in the node agent (and not the velero pod) is because processing the DU/DD required host path access, so it needed to be on the same node as the mounting pod. If we're doing all of the kopia work from the backup/restorePod, then wouldn't it make more sense to move the DU/DD reconcilers to the main velero server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we did this, then node agent would remain privileged always, but if you're using datamover without fs-backup, then you wouldn't need to enable the node agent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving the DUCR/DDCR controller to the backupPod/restorePod is feasible technically, but we didn't choose this for below reasons:
- Making the DUCR/DDCR controller outside of the backup/restorePod helps to better control the data movement workflow. We have one part in one module and the other part in the other module, this is something like the concept of "multiple failure domains", so when one part fails, we always get some way to be notified and update the DUCR/DDCR
- Since we want the DUCR/DDCR controller outside of the backup/restorePod, we have two choices --- velero server and node-agent server. We didn't choose the velero server primarily because of the isolation, that is, we want to isolate the control path and the data path; we also want to isolate the resource backup and the volume data backup
- As another concept we are following, we want to run the as minimal part into the backupPod/restorePod as possible, so in the design we actually call it
VGDP micro service
, that is we only run the VGDP in the backupPod/restorePod. That also adheres to the concept of micro service - By keeping everything else in node-agent, we don't bing impact to the existing data mover features, i.e., node concurrency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While running VGDP instances as dedicated pods offers better resource control, it may introduce scalability challenges, particularly in large clusters with many backup/restore operations. Each operation will now spawn a new pod, which could lead to a significant increase in resource consumption and potential scheduling delays. Should the design include something on implementing resource quotas and limits specific to VGDP pods to prevent overconsumption of cluster resources ?
4fb4c95
to
213589a
Compare
Actually, we didn't increase the allocation of pod resources in this design. With the old design, we still create one backupPod/restorePod for each volume, merely, we run dummy command in the pods. And the pods keep the same lifecycle before or after this design. This is a good point to clarify in the design, I will add it. |
Signed-off-by: Lyndon-Li <[email protected]>
213589a
to
544d796
Compare
Done all the comments, please continue to review. |
@sseago @shubham-pampattiwar Any more comments on this PR? Once you finish the review, please help to approve it. |
All good from my perspective. I do still think that this microservice approach, gives us a chance to extend this design and make the Datamovers more pluggable. I think that this would be a huge win but makes sense as a follow on |
Fix issue #7198. Add the design for data mover micro service