-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add design for backup repository configurations #7963
Add design for backup repository configurations #7963
Conversation
Signed-off-by: Lyndon-Li <[email protected]>
6d62803
to
028e221
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7963 +/- ##
==========================================
+ Coverage 58.79% 58.82% +0.02%
==========================================
Files 345 346 +1
Lines 28766 28892 +126
==========================================
+ Hits 16914 16995 +81
- Misses 10423 10468 +45
Partials 1429 1429 ☔ View full report in Codecov by Sentry. |
028e221
to
21f34db
Compare
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.
In general I do like the design.
21f34db
to
f497a21
Compare
The BackupRepository configMap is created by users. If the configMap is not there, nothing is specified to the backup repository CR, so the Unified Repo modules use the hard-coded values to configure the backup repository. | ||
The BackupRepository configMap is backup repository type specific, that is, for each type of backup repository, there is one configMap. Therefore, a ```backup-repository-config``` label should be applied to the configMap with the value of the repository's type. During the backup repository creation, the configMap is searched by the label against the repository type, if no configMap is found, nothing is set to the backup repository CR. | ||
|
||
### Configurations |
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.
Should we also document the list of parameters that are configurable and the ones that are hard coded for kopia repo ?
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.
cache-limit-mb
and enable-compression
are the supported parameters.
There are no other parameters that should be exposed to users, so they are not relevant to this design. But we can find all the parameters for kopia from the code at https://github.com/vmware-tanzu/velero/blob/main/pkg/repository/udmrepo/kopialib/backend/common.go
f497a21
to
8b2e616
Compare
c81094d
to
12f0c66
Compare
@shubham-pampattiwar Made some slight changes, please review again. Thanks. |
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.
/lgtm
design/backup-repo-config.md
Outdated
repoConfig: | | ||
{ | ||
"cacheLimitMB": 2048, | ||
"enableCompression": true |
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 also think it's worth considering allowing other repo configuration options to be configurable via this design. Namely thinking of different kopia repo options e.g.:
https://github.com/wawa0210/velero/blob/89c10ddcc04e4dc7354f284434c2ddb8c121780c/pkg/repository/udmrepo/repo_options.go#L63-L65
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.
@weshayutin ^^
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.
Let's do this incrementally in future based on the requirements.
For now, the 3 options you mentioned are too advanced(especially for the hash algorithm and chunking algorithm, without a good knowledge of the deduplication and the status of their own data, users cannot decide a better value than the default ones) and not general enough in terms of unified repository concepts(many backup repositories/storages are using private chunking/hashing algorithms and don't allow users to change, because those have heavy impacts on the QOS of the repo).
52d0425
to
dd29985
Compare
@mpryc @shubham-pampattiwar @blackpiglet @reasonerjt
Please have further review. Thanks. |
@Lyndon-Li I am fine with either of the approaches. Would like to know why the change in approach though ? |
After some discussion, we would like to unify the way to set configurations through configMap (including node-agent configs, backup repository configs and maintenance job configs) to velero:
The would help the downstream users (which integrate velero) to better control velero's behavior in a consistent way. cc @reasonerjt |
design/backup-repo-config.md
Outdated
To create the configMap, users need to save something like the above sample to a file and then run below commands: | ||
``` | ||
kubectl create cm <config-name> -n velero --from-file=<json file name> | ||
kubectl label cm <config-name> -n velero backup-repository-config=<repository type> |
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.
Is the step of adding label still needed?
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.
No, it is not required, I have removed it.
design/backup-repo-config.md
Outdated
## Installation | ||
In order to set the ```--backup-repository-config``` parameter to the velero server, a new installation parameter ```--backup-repository-config``` will be added. An example of the installation as below: | ||
``` | ||
velero install --backup-repository-config <configmap-name> |
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.
This could be optional b/c we can hard code a configmap name and pass it to the velero server, and the user will only need to create the configmap with the hard-coded name.
If we took this approach ^ we may not need to update the installation flow, bearing in mind that when velero is installed it's very possible the namespace of velero is not created.
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.
We will remove this installation flag and keep the velero server flag.
By default installation using velero CLI, the server flag is not set; users need to modify the deployment to set the flag and wait velero server to restart.
|
||
Below are the struct for the configMap: | ||
``` golang | ||
type RepoConfig struct { |
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 wanna clarify, it's the RepoConfig
will be populated to the CR right? If that's the case, should the field in the backup repo CR be singular (repositoryConfig
) or plural (repositoryConfigs
)? Singular may be slightly better?
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.
Changed the field in the CRD to repositoryConfig
Signed-off-by: Lyndon-Li <[email protected]>
dd29985
to
c01c679
Compare
The BackupRepository configMap is created by users in velero installation namespace. The configMap name must be specified in the velero server parameter ```--backup-repository-config```, otherwise, it won't effect. | ||
If the configMap name is specified but the configMap doesn't exist by the time of a backup repository is created, the configMap name is ignored. | ||
For any reason, if the configMap doesn't effect, nothing is specified to the backup repository CR, so the Unified Repo modules use the hard-coded values to configure the backup repository. |
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 velero be watching for changes to CM? or will it only parse the value at startup? Or per backup?
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 think its at startup and per backup, @Lyndon-Li lets clarify that
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.
When a backupRepository CR is created, this CM is visited. So Velero doesn't watch the changes to the CM, but users are allowed to change the content during runtime, the changes will effect for the next created backupRepository. See below statement in the design:
When the backup repository CR is created by the BackupRepository controller, the configurations in the configMap are copied to the ```repositoryConfig``` field.
Add design for backup repository configurations for issue #7620, #7301