feature: configurable backup schedules and retention for development environments #3087
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.
Checklist
As described in #3073 it could be useful to define separate schedules and retention periods for development environments.
The aim of this PR is to allow backups for development environments of type
branch
orpullrequest
to have different backup schedules and retention periods configured. It is possible to allow pullrequests to have a completely different schedule to all other environments as well. Individual environments can also have their schedule and retention adjusted individuallyThe behaviour will be as below:
remote-controller
or fall back to hardcoded values inkubectl-build-deploy-dind
branch
orpullrequest
branch
type, and is a development environmentLAGOON_BACKUP_DEV_RETENTION
andLAGOON_BACKUP_DEV_SCHEDULE
are defined, and will use the values of these to override the defaultsLAGOON_BACKUP_DEV_RETENTION
andLAGOON_BACKUP_DEV_SCHEDULE
are not definedremote-controller
could inject existLAGOON_FEATURE_BACKUP_DEV_RETENTION
andLAGOON_FEATURE_BACKUP_DEV_SCHEDULE
remote-controller
or hardcodedpullrequest
typeLAGOON_BACKUP_PR_RETENTION
andLAGOON_BACKUP_PR_SCHEDULE
are defined, and will use the values of these to override the defaultsLAGOON_BACKUP_PR_RETENTION
andLAGOON_BACKUP_PR_SCHEDULE
are not definedremote-controller
could inject existLAGOON_FEATURE_BACKUP_PR_RETENTION
andLAGOON_FEATURE_BACKUP_PR_SCHEDULE
DEV
environment variables are defined before finally falling back to what is provided byremote-controller
or hardcodedThe way to define these variables is as follows:
X_RETENTION
variables should be defined asH:D:W:M
, which ishourly
,daily
,weekly
,monthly
as colon separated values.Example,
0:7:6:1
, whereX_SCHEDULE
variables are just the cron definition.Example,
M H(22-2) * * *
Closing issues
closes #3073