-
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
Pre/Post Backup & Pre/Post Restore Plugins #1150
Comments
Our backup and restore item action |
Definitely agree. Post Restore would be the priority scenario. The rest may be generalized under the feature add but aren't required immediately. |
After thinking about it further, The Post Restore hooks would need a caveat.....mainly in a scenario of restoring a database/etc, the hooks needs to happen just before exposing the Service so higher level apps don't start trying to execute transactions before data is fully restored. An init container can solve this. It just leaves breadcrumbs that we might not want every time. |
Let's walk through the scenarios in full detail. Backup
Restore
Post-restore, pod restart and/or scale-up
I'm not sure an initContainer would work, because you'd need the main Instead, I think you could use an exec-based liveness and/or readiness probe on the mysql pod. It could wait for the presence of marker file (placed by the restore item action plugin) before saying live/ready. You'd have to be careful to get it in a path that survives restarts, so it would need to be in a volume instead of something like |
Your scenario is accurate. Would the probe also remove our ability to connect to the service to write the dump back in? |
How are you planning on making your restore item action plugin talk to mysql? If you're going through the |
Just approaching that now. Probably can't use the |
So the pattern can also match that of Restic. An init container with the mysql PVC mounted can start Thoughts? |
The pod's init container would not have access to the credentials to talk to object storage, though? I would like to spend some more time thinking about how we can allow users to store arbitrary data in object storage. And then retrieve it when restoring. That's going to be a real need, isn't it? |
I agree....I tried to figure out if I could steal your plugin registry and create a gRPC client to talk to the object store but in the end have opted for pulling code from the The fact that the svc account is available to a plugin also means I can create k8s objects and opted to just skip the init and instead pause the entire backup progress by inspecting runtime.Unstructured and creating a copy temporary Pod. It mounts the same PVC so the actual Pod will see the data as if it took a restart when it finally comes up. |
So following back up @ncdc We got everything working, backup, restore, object storage handling, etc. Hid it behind a nice extensible interface; all that good stuff. I would like to revisit this in terms of hooking the object store and the plugin concepts you discussed, it is something else to maintain and need to stay in sync with the BackupStorageLocations object. The Post Restore piece does require a lot of thought since we want Ark to restore the Pod to a functional state, then do a check for plugins registered for Post Restore hooks that have an AppliesTo of |
@king-jam thanks for the update. We are knee-deep in project renaming work, but we should be able to come up for air starting next week. Thanks for being patient! |
I'm in the same boat on this one. I'm running into issues with mariadb-galera and having crash consistent backups. Any news on this issue? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing the stale issue. |
Describe the solution you'd like
I'd like to be able to use the same plugin framework but guarantee ordering based on the registration call within the plugin framework. This is for scenarios where "rehydration" of data is required via an application specific hook.
The current example that I'm working with is backup/restore of a MySQL environment. PV Snapshots only provide a crash consistent approach whereas leveraging
mysqldump
provides a point-in-time application consistent backup. The existing plugin framework does not encounter issues during backup but during restore is unable to guarantee that the plugin will execute after the service endpoint is up.The workaround is to use the restore plugin action as a timing sequence to start a separate job that can remotely rehydrate the database but that results in the ark restore reporting success before the database is actually restored. This could create an issue with how statuses are conveyed to a user or an automation system that wraps the ark CLI.
Anything else you would like to add:
N/A
Environment:
ark version
): v0.10.0kubectl version
): v1.13.0/etc/os-release
): Ubuntu 18.04.1 LTSThe text was updated successfully, but these errors were encountered: