-
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
Enable Attach/Detach Controller #26351
Enable Attach/Detach Controller #26351
Conversation
9d1e678
to
57da768
Compare
57da768
to
87ccfdc
Compare
Temporarily disable node-problem-detector to unblock #26351
bb27c79
to
cacfb2a
Compare
Ran all the PD tests back to back overnight with these changes, and zero failures. Woo hoo :) |
cacfb2a
to
e3b064c
Compare
@saad-ali |
@k8s-merge-robot you're drunk, go home |
@saad-ali seems like this should have a release note to me, agree? |
Link? |
if err != nil { | ||
glog.V(10).Infof( | ||
"Failed to delete volume %q for pod %q/%q from desiredStateOfWorld. GetUniqueVolumeName failed with %v", | ||
"Failed to delete volume %q for pod %q/%q from desiredStateOfWorld. GenerateUniqueDeviceName failed with %v", |
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.
Nit: log messages are supposed to start with lowercase letters -- no need to fix now, perhaps in a follow up.
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.
My understanding is that rule is for error strings, since they may be concatenated at a higher level before being printed. But log messages are basically the end of the line so it is ok to capitalize in a way that makes it user readable.
GoLang guidence (https://github.com/golang/go/wiki/CodeReviewComments#error-strings) seems to align with this: This does not apply to logging, which is implicitly line-oriented and not combined inside other messages.
Yep, added release not to PR.
No issue to track it since all the kubelet code for mount/unmount/attach/detach is being rewritten. Mondo PR based on this PR is pending. It removes this note and fixes the issue. |
e3b064c
to
0f92bb4
Compare
Thanks Paul! Feedback addressed, PTAL Will squash commits on LGTM |
@@ -83,6 +84,11 @@ type ActualStateOfWorld interface { | |||
// reflecting which volumes are attached to which nodes based on the | |||
// current actual state of the world. | |||
GetAttachedVolumes() []AttachedVolume |
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.
Does anything actually use the global list of attached volumes 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.
Yes, this list is used by the reconciler
This PR contains Kubelet changes to enable attach/detach controller control. * It introduces a new "enable-controller-attach-detach" kubelet flag to enable control by controller. Default enabled. * It removes all references "SafeToDetach" annoation from controller. * It adds the new VolumesInUse field to the Node Status API object. * It modifies the controller to use VolumesInUse instead of SafeToDetach annotation to gate detachment. * There is a bug in node-problem-detector that causes VolumesInUse to get reset every 30 seconds. Issue kubernetes/node-problem-detector#9 opened to fix that.
0f92bb4
to
9dbe943
Compare
Thanks Paul. Added comments to test. PTAL |
GCE e2e build/test passed for commit 9dbe943. |
attachedVolumes := asw.GetAttachedVolumesForNode(nodeName) | ||
|
||
// Assert | ||
if len(attachedVolumes) != 1 { |
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.
for stuff like this i like to use this syntax:
if l := len(attachedVolumes); l != 1 {
t.Fatalf("bla bla %v", l)
}
..but you can do that in a follow up if you so choose.
LGTM, looking forward to reading the next chapter of this tale. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 9dbe943. |
Automatic merge from submit-queue |
This PR contains changes to enable the attach/detach controller introduced in #25457 (proposed in #20262).
Specifically it:
enable-controller-attach-detach
kubelet flag to enable control by attach/detach controller. Default enabled.SafeToDetach
annotation from controller.VolumesInUse
field to the Node Status API object.VolumesInUse
instead ofSafeToDetach
annotation to gate detachment.VolumesInUse
before Mount and after Unmount.node-problem-detector
binary that causesVolumesInUse
to get reset to nil every 30 seconds. Issue Node-Problem-Detector should Patch NodeStatus not Update node-problem-detector#9 (comment) opened to fix that.Fixes #14642, #19953