-
Notifications
You must be signed in to change notification settings - Fork 89
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
PB-4958: RT for restore flow for non-nfs BLs #1596
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1596 +/- ##
==========================================
+ Coverage 66.95% 67.95% +0.99%
==========================================
Files 43 43
Lines 5571 5704 +133
==========================================
+ Hits 3730 3876 +146
+ Misses 1502 1496 -6
+ Partials 339 332 -7 ☔ View full report in Codecov by Sentry. |
// rtTemplate := &storkapi.ResourceTransformation{} | ||
// a.client.Get(context.Background(), types.NamespacedName{Name: restore.Spec.ResourceTransformationTemplate, Namespace: kdmputils.AdminNamespace}, rtTemplate) | ||
|
||
var gvkResourceTransform map[schema.GroupVersionKind][]storkapi.TransformSpecs |
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.
@sgajawada-px The array nature of TransformSpecs will be effectively utilised only in future wherein we have multiple set of rules for a single type of resource and it is via a two different selector. As of current UX we don't support this via UI.
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.
Yes it's just good to have support from our end.
|
||
if gvkResourceTransform != nil { | ||
objects := make([]*unstructured.Unstructured, 0) | ||
if err = json.Unmarshal(nsData, &namespaces); err != nil { |
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 sound like a hack because of the way we store namespace resources., We should have fixed while we are backing up namespaces with GVK info in namespace.json. While doing actual implementation lets see if we have to chnage in backup path and how big that challenge would be
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.
TODO for the actual implementation
@@ -121,6 +126,9 @@ func (r *ResourceTransformationController) handle(ctx context.Context, transform | |||
return nil |
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.
TODO: During r.validateSpecPath(transform) need to remove the filter getsupportsk8stypes to allow cr and crds in rt only for the restore flow
return gvkResourceTransform, fmt.Errorf("empty name received for resource transformation/namespace") | ||
} | ||
|
||
resp, err := storkops.Instance().GetResourceTransformation(transformName, namespace) |
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.
As this is called n times from
verifyNamespace - download namespace.json
VolumeStage - download storageclass.json, resources.json, crd.json
ApplicationStage - download resources.json, crd.json
Is good to have a cache for RT CR object instead of reaching out to apiserver
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 need to check also when the RT template reaches its high watermark interms of rules how big this in-memory copy shoots up. Else in case of multiple restore with multiple RT template this in memory size will bloat the whole cluster memory consumption
This is a POC NOT FOR REVIEW
What type of PR is this?
What this PR does / why we need it:
It is a POC to test the resource transformation during the restore controller. As part of it we can transform all kubernetes resources in the backup object expect CRDs for the non-NFS BLs
Does this PR change a user-facing CRD or CLI?:
Yes, ApplicationRestore CRD we are accepting resourceTransformationTemplate name in the spec to transform the application specs in the backup object.
Is a release note needed?:
Yes,
Does this change need to be cherry-picked to a release branch?:
Unit Test Results