-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Improve messaging on volume expansion #58415
Improve messaging on volume expansion #58415
Conversation
/test pull-kubernetes-unit |
/assign
|
The condition is removed here - https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/util/operationexecutor/operation_generator.go#L1372 Currently we don't seem to be showing Conditions in pvc describe. Will fix this in a follow up PR. e2e test.. okay, will add. :-) |
Ack
Ack |
Type: v1.PersistentVolumeClaimFileSystemResizePending, | ||
Status: v1.ConditionTrue, | ||
LastTransitionTime: metav1.Now(), | ||
Message: "Restart pod that is using this claim to finish File system resize on node", |
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.
IMO, it should say why the condition is set. "Waiting for user to (re-)start a pod to finish resize of the volume" or something in this direction?
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.
fixed
fa751f6
to
57efdce
Compare
/lgtm |
/test pull-kubernetes-e2e-kops-aws |
Flaked on #58387 /test pull-kubernetes-e2e-kops-aws |
/test pull-kubernetes-e2e-kops-aws |
We cannot blindly remove/reset all conditions. Anywhere this flow is doing that needs to be corrected. I saw at least these places:
kubernetes/pkg/controller/volume/expand/cache/volume_resize_map.go Lines 153 to 155 in 6ec4cb1
updatePVCCapacityAndConditions should be modified so that it doesn't encourage wholesale replacement of status conditions
The kubelet/node condition updating code is a good example to look at: kubernetes/pkg/kubelet/kubelet_node_status.go Lines 805 to 823 in 6ec4cb1
It updates a specific condition, leaving all others undisturbed. |
57efdce
to
168f39f
Compare
168f39f
to
18c9a5b
Compare
@liggitt I have updated the code, so as it only considers Conditions that volume expand controller explicitly knows about. Also, I have updated PVC update to use PATCH in both controller-manager and kubelet while I was at it. PTAL |
18c9a5b
to
0a4a593
Compare
/retest |
0a4a593
to
4d8bf53
Compare
[MILESTONENOTIFIER] Milestone Pull Request Needs Approval @davidz627 @gnufied @jsafrane @kubernetes/sig-storage-misc Action required: This pull request must have the Pull Request Labels
|
for _, condition := range oldConditions { | ||
// If Condition is of not resize type, we keep it. | ||
if _, ok := knownResizeConditions[condition.Type]; !ok { | ||
newConditions = append(newConditions, condition) |
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 reorders conditions, which we don't want. see https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kubelet_node_status.go#L770-L788 for an example of in-place updating of an existing condition, then appending to the end if no existing condition is found
- if the condition already exists and already has the same status, there should be no change
- if the condition already exists with a different status, the status and timestamp should update
- if the condition does not exist, it should get appended to the end
only in case 2 and 3 should we attempt an update of the object
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 fixed this. I did not quite use same approach as code you linked but the end result should be same.
once the condition reordering/updating is worked out, I think this looks right, though I'm having trouble following where each of the two conditions are added/removed (controller-side or kubelet-side). Will defer to the storage reviewer for those details. |
b90cb09
to
061ed90
Compare
pkg/volume/util/resize_util_test.go
Outdated
{ | ||
Type: v1.PersistentVolumeClaimResizing, | ||
Status: v1.ConditionTrue, | ||
LastTransitionTime: metav1.Now(), |
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.
add time to this so it is distinctly different than currentTime
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.
fixed
one nit on test, condition handling looks good to me otherwise. will defer to storage reviewer for lgtm on overall flow. |
- we now provide clear message to user what to do when cloudprovider resizing is finished and file system resizing is needed. - add a event when resizing is successful. - Use Patch for updating PVCs in both kubelet and controller-manager - Extract updating pvc util function in one place. - Only update resize conditions on progress
061ed90
to
1fa8cbc
Compare
@jsafrane can you PTAL. |
@liggitt fixed the minor nit, you pointed out in test case. /assign @derekwaynecarr |
/lgtm |
ping @derekwaynecarr @smarterclayton , it would be really nice to have this approved. The pending approval in |
/assign @smarterclayton |
kubelet changes lgtm. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: childsb, derekwaynecarr, gnufied, jsafrane, liggitt The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test pull-kubernetes-e2e-kops-aws |
Automatic merge from submit-queue (batch tested with PRs 52942, 58415). If you want to cherry-pick this change to another branch, please follow the instructions here. |
and file system resizing is needed.