Skip to content
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

Kube Object Protection Enhancements #1531

Open
1 of 30 tasks
raghavendra-talur opened this issue Aug 27, 2024 · 0 comments
Open
1 of 30 tasks

Kube Object Protection Enhancements #1531

raghavendra-talur opened this issue Aug 27, 2024 · 0 comments
Assignees

Comments

@raghavendra-talur
Copy link
Member

raghavendra-talur commented Aug 27, 2024

Kubeobjects

Simplify the code for easier maintenance and accessibility to new contributors

  • Remove the usage of function pointers
  • Refactor to have one function for every state (primary, secondary) and action (relocate, failover). We want to make it trivial to understand which code run for at which state of the system. If we have common code running in many states/actions it can move to helpers.
  • Comment unexpected behavior (e.g creating a dummy backup to perform a restore). This may not be needed after we fix the BSL issues, since velero will create the related backups.

Correctness

Understanding current behavior

  • Verify what happens to resources which already exist on the target cluster(overwritten or skipped)
  • Debug if includeClusterResources == true works
  • Is a backupRef necessary in a recoverWorkflow? If yes, can we make it not required?

Better implementation

  • We make 2 backups(0 and 1) and store the capture id we need to recover from in the VRG. Find a way to determine the capture id by without using the VRG.
  • When using recipes, volumes section or the group section of type "volume" should be able to specify consistency groups.

Logs

  • Log more specific logs with only the relevant information for every backup phase. Currently we log all backup/restore properties for every reconcile
  • Don't log huge and unneeded values (e.g. complete CA base64 value). Huge values makes it harder to find the needed details.

Errors

  • Include relevant context (e.g. validationErrors when backup or restore fail with phase ValidationFailed)
  • Use actual phase names from velero (e.g. ValidationFailed) instead of fake names (backupValidationFailed) that are not searchable (code use "backup" + string(Phase))
  • Don't log an error and return it - we want one log with all the context for every error. Minimize the time to find the relevant context when debugging.

Testing

  • Add a test in integration tests/e2e that can perform backup and restore without the hub

Names

  • We have "backup" and "restore" (velero), "capture" and "recover", and "protect". Use one term for the same thing inside ramen. Since we already use "restore" (e.g. for pvcs) using "backup" and "restore" seems like the best way.

Recipe

  • Implement check hooks
  • Implement sync hooks
  • Implement exec hooks
  • Reconcile the recipe CRD to match the latest API used by the other components
@raghavendra-talur raghavendra-talur self-assigned this Aug 27, 2024
@asn1809 asn1809 self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants