-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Enable node-expansion to be called on all nodes for RWX volumes #108693
Enable node-expansion to be called on all nodes for RWX volumes #108693
Conversation
@gnufied: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
4efb040
to
2b9af72
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied 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 |
2b9af72
to
99adb3b
Compare
/retest |
/retest |
pkg/controller/volume/attachdetach/cache/actual_state_of_world.go
Outdated
Show resolved
Hide resolved
195c666
to
dee48d3
Compare
92dab4e
to
6bc8275
Compare
@jsafrane Updated events to include node names:
|
I also tested with multiple kubelets and restarts. It is working as expected and whichever kubelet did not observe resize event while it was up, will not call |
resizeResponse.err = msg | ||
return resizeResponse | ||
} | ||
func (og *operationGenerator) nodeExpandVolume( |
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.
where this function is called?
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.
It gets called from doOnlineExpansion
function which in turn gets called from ExpandInUsePersistentVolume
function.
@@ -712,7 +703,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc( | |||
klog.V(verbosity).InfoS(detailedMsg, "pod", klog.KObj(volumeToMount.Pod)) | |||
resizeOptions.DeviceMountPath = volumeMounter.GetPath() | |||
|
|||
_, resizeError = og.nodeExpandVolume(volumeToMount, actualStateOfWorld, resizeOptions) | |||
_, resizeError = og.expandVolumeDuringMount(volumeToMount, actualStateOfWorld, resizeOptions) |
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.
are you changing the function name from nodeExpandVolume to expandVolumeDuringMount? The tests should also updated?
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.
So logic for calling expansion during mount is slightly different from online expansion later on. During mount - we fetch PVC size from api-server and check if volume requires expansion, because during mount this would be the first time volume was observed and hence value in ASOW will be same as value in pvc.Status
.
For online expansion while pod is running, however we strictly compare desired and actual sizes. There are tests in reconciler_test.go, which exercise this at higher level.
/lgtm |
/lgtm |
/hold cancel |
/milestone v1.24 |
#109264 noted tests failing with nil pointer errors that might be related to this PR |
Thanks I am looking into those. posted some updates - #109264 (comment) |
This PR implements support for calling
NodeExpandVolume
on all nodes in case of RWX volumes. It does so by storingpvSpecSize
indesiredStateofWorld
andpvcStatusSize
inactualStateofWorld
.I tested with CSI Mock driver and RWX enabled (branch here - https://github.com/gnufied/csi-test/tree/make-rwx-possible )
and it seems to be working as expected: