-
Notifications
You must be signed in to change notification settings - Fork 272
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
Default storage class for virtualization purposes #2913
Default storage class for virtualization purposes #2913
Conversation
Skipping CI for Draft Pull Request. |
/test all |
/test pull-cdi-unit-test |
/retest |
a727630
to
68be7f8
Compare
68be7f8
to
d0a352f
Compare
/test pull-containerized-data-importer-e2e-ceph |
44f4a6c
to
a6cdc92
Compare
/retest |
pkg/controller/common/util.go
Outdated
@@ -211,6 +212,8 @@ const ( | |||
|
|||
//AnnDefaultStorageClass is the annotation indicating that a storage class is the default one. | |||
AnnDefaultStorageClass = "storageclass.kubernetes.io/is-default-class" | |||
// AnnDefaultVirtStorageClass is the annotation indicating that a storage class is the default one for virtualization purposes | |||
AnnDefaultVirtStorageClass = "storageclass.kubevirt.io/is-default-class" |
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 this should be storageclass.kubevirt.io/is-default-virt-class to avoid confusion with the standard k8s annotation. I know we have a different URI but still.
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.
Was just following the pattern
snapshot.storage.kubernetes.io/is-default-class
ingressclass.kubernetes.io/is-default-class
storageclass.kubernetes.io/is-default-class
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 am up for extra clarity though so just let me know if this still makes sense
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.
Done
@@ -369,6 +369,7 @@ func getTokenPrivateKey() *rsa.PrivateKey { | |||
func registerMetrics() { | |||
metrics.Registry.MustRegister(controller.IncompleteProfileGauge) | |||
controller.IncompleteProfileGauge.Set(-1) | |||
metrics.Registry.MustRegister(controller.DefaultVirtStorageClassesGauge) |
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 StorageProfile status report if a StorageClsss is a virt default?
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.
Good point, not sure if anyone would look up storage profiles though
pkg/controller/common/util.go
Outdated
// default kubevirt storage class (if the caller is interested) storageclass.kubevirt.io/is-default-class | ||
// default k8s storage class storageclass.kubernetes.io/is-default-class | ||
// If no storage class is found, returns nil | ||
func GetStorageClassByNameWithVirtFallback(ctx context.Context, client client.Client, name *string, considerVirtSc bool) (*storagev1.StorageClass, error) { |
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.
Why both GetStorageClassByName
and GetStorageClassByNameWithVirtFallback
? I'm sure there's a good reason. Prob worth adding a comment why
Also, bool params should be avoided when possible. Maybe it would be better to have function take a DataVolume as a param instead?
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.
Why both
GetStorageClassByName
andGetStorageClassByNameWithVirtFallback
? I'm sure there's a good reason. Prob worth adding a comment why
Renamed to better communicate the reason.
Basically, there will still be flows where you don't want to take the virt sc into account, quick example is when using the PVC
API
Also, bool params should be avoided when possible. Maybe it would be better to have function take a DataVolume as a param instead?
Yes definitely. Hopefully this is better now, whole DV was a bit overkill but content type should be fine
a6cdc92
to
25f35c0
Compare
/retest |
/retest-required |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mhenriks The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
25f35c0
to
f0c7ab7
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.
looks good, just one minor code duplication question
Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
f0c7ab7
to
462f400
Compare
/test pull-containerized-data-importer-e2e-istio |
What this PR does / why we need it:
Storage providers in the field may supply many ways of utilizing a back end storage solution;
They do so by providing different Kubernetes StorageClass parameters.
With the growth of kubevirt adoptions, we may sometimes see a certain combination of storage class parameters is preferrable for VM workloads.
This PR presents a possible way of steering kubevirt users
towards using such identified storage class.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Was considering not doing functional tests but this feels too important.
There is little to no penalty because the entire block of tests I'm adding takes less than 30 seconds.
(No wait for dv success)
Release note: