-
Notifications
You must be signed in to change notification settings - Fork 1.1k
make bucket prefix for logical backup configurable #2609
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
Conversation
hughcapet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it make sense to also update the e2e test ?
| S3 bucket to store backup results. The bucket has to be present and | ||
| accessible by Postgres pods. Default: empty. | ||
|
|
||
| * **logical_backup_s3_bucket_prefix** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mention that "/" is required? (from what I see in the implementation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the tailing / to the logical backup script. Even if users leave the prefix blank // will be treated as /. So it's not needed to specify it.
|
👍 |
1 similar comment
|
👍 |
In order to configure separate S3 lifecycle rules for basebackups and logical backups living in the same bucket, we have to make the logical backup prefix configurable. Unlike Spilo, this approach works in the logical backup script.
There's one more problem though: The operator only diffs logical backup jobs on their image and schedule. Thus, existing jobs will not be updated when changing the prefix. This problem has also been described in issue #768.
Therefore, I have extended the diff to also compare containers for which I have reused the comparison method of the statefulset pod template. It's not super clean - there's a check for lazy update which does not apply for the logical backup cronjob. The word
statefulsetmust now be passed as part of the description to not produce confusing logs for cron job diffs.Because the cronjob diff function now calls
compareContainers- aclusterfunction - the function needs a cluster receiver, too. I moved it from k8sutil to cluster package and renamed it to align it with other diff functions.With this PR I have also move the actual logical backup code outside of the
dockerfolder, because it should exist on the same level as e.g. theui(and futurepoolerfolder). Adjusted the build scripts accordingly.