-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Schedule Unpause Trigger Config Design
Signed-off-by: Tiger Kaovilai <[email protected]>
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Schedule Unpaused Triggers Config Design | ||
## Abstract | ||
User want to configure what happens when schedule is unpaused. Either run backup immediately or at the next cron schedule. This design proposes to add a new field to the schedule spec to allow user to configure the behavior | ||
|
||
## Background | ||
Currently, the default behavior is to run the trigger immediately and may not be desired by all users (https://github.com/vmware-tanzu/velero/issues/6517) | ||
|
||
## Goals | ||
- Make schedule unpaused behavior configurable | ||
|
||
## Non Goals | ||
- Changing the default behavior | ||
|
||
|
||
## High-Level Design | ||
Add a new field with to the schedule spec to allow user to configure the behavior defaulting to prior behavior of triggering backup immediately. | ||
|
||
## Detailed Design | ||
### CLI Changes | ||
`velero schedule unpause` will now take an optional bool flag `--unpause-triggers` to allow user to override the behavior configured in the schedule spec. | ||
|
||
`velero schedule unpause schedule-1 --unpause-triggers=false` will unpause the schedule but not trigger the backup immediately. | ||
|
||
`velero schedule unpause schedule-1 --unpause-triggers=true` will unpause the schedule and trigger the backup immediately. | ||
|
||
`velero schedule unpause schedule-1` will unpause the schedule and trigger the backup immediately. This is the same behavior as before. | ||
|
||
### API Changes | ||
``` | ||
// ScheduleSpec defines the specification for a Velero schedule | ||
type ScheduleSpec struct { | ||
// Template is the definition of the Backup to be run | ||
// on the provided schedule | ||
Template BackupSpec `json:"template"` | ||
// Schedule is a Cron expression defining when to run | ||
// the Backup. | ||
Schedule string `json:"schedule"` | ||
// UseOwnerReferencesBackup specifies whether to use | ||
// OwnerReferences on backups created by this Schedule. | ||
// +optional | ||
// +nullable | ||
UseOwnerReferencesInBackup *bool `json:"useOwnerReferencesInBackup,omitempty"` | ||
// Paused specifies whether the schedule is paused or not | ||
// +optional | ||
Paused bool `json:"paused,omitempty"` | ||
// UnpauseTriggers specifies whether to trigger backup immediately when schedule is unpaused | ||
// +kubebuilder:default:=true | ||
// +kubebuilder:validation:Optional | ||
UnpauseTriggers bool `json:"unpauseTriggers,omitempty"` | ||
} | ||
``` | ||
|
||
## Alternatives Considered | ||
|
||
`velero server` flags to configure the behavior. This is not ideal as it is a global setting. This behavior should be configurable per schedule. | ||
|
||
|
||
## Security Considerations | ||
None | ||
|
||
## Compatibility | ||
Upon upgrade, the new field will be added to the schedule spec automatically and will default to the prior behavior of triggering backup immediately. | ||
|
||
Since this is a new field, it will be ignored by older versions of velero. | ||
|
||
## Implementation | ||
TBD | ||
|
||
## Open Issues | ||
A discussion of issues relating to this proposal for which the author does not know the solution. This section may be omitted if there are none. |