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.
This Pull Request modifies the scheduled backup feature that was introduced in #553. The implementation in the original PR is rather simple and was a "v1". The CRD
VitessBackupSchedule
was introduced, giving the option to end-users to configure differentStrategy
- which tells which keyspace/shard we want to benchmark. PerVitessBackupSchedule
all these strategies were merged together to form a singlevtctldclient
command that would be executed in a K8S'sJob
following the schedule set in theVitessBackupSchedule
.While this approach works, it has limitation: it uses
vtctldclient
which will temporarily take out a serving tablet from the serving tablet pool and use it to take the backup. While this limitation is documented in the release notes, we want to encourage people to usevtbackup
as an alternative.The goal of this Pull Request is to modify the
VitessBackupSchedule
controller to create K8S'sJob
with avtbackup
pod instead of a dummy pod running avtctldclient
command. This new goal introduces a new complexity inherited byvtbackup
: avtbackup
pod can only backup one shard. Which is significantly different than the previous implementation where we created a dummy pod that would contain a shell command executingvtctldclient
as many times as we had aStrategy
in theVitessBackupSchedule
CRD. To fit this new requirement, theVitessBackupSchedule
controller's logic was changed to create as manyJob
as we haveStrategy
in the CRD. TheJob
s are named after the CRD's name + the keyspace + the shard range. For everyJob
a newPVC
is also created, which is used by thevtbackup
pod. Both theJob
andPVC
are owned by theVitessBackupSchedule
CRD and will be removed following the retention policy set by the end-users.