-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Attach Detach Controller Business Logic #25457
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
Attach Detach Controller Business Logic #25457
Conversation
This PR is not yet complete. But I wanted to give you a chance to start looking at it. What's left:
|
98f03e6
to
d583987
Compare
d583987
to
62cc762
Compare
62cc762
to
4e7b676
Compare
fcf1e70
to
cc104eb
Compare
pvInformer, | ||
ResyncPeriod(s)(), | ||
cloud, | ||
ProbeAttachableVolumePlugins(s.VolumeConfiguration.FlexVolumePluginDir)) |
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 feels a bit awkward.. perhaps pass the whole VolumeConfig struct and fish out the settings needed for each plugin in ProbeAttachableVolumePlugins. It is only FlexVolume now but may expand in the future
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.
Ack, changed.
e9fff2d
to
918e1e2
Compare
Ready to review. |
allPlugins = append(allPlugins, gce_pd.ProbeVolumePlugins()...) | ||
allPlugins = append(allPlugins, git_repo.ProbeVolumePlugins()...) | ||
allPlugins = append(allPlugins, host_path.ProbeVolumePlugins(volume.VolumeConfig{})...) | ||
allPlugins = append(allPlugins, nfs.ProbeVolumePlugins(volume.VolumeConfig{})...) |
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 it looks like nfs and probably hostPath expect a non-empty configuration... it shouldn't really matter anyways because they are not attachable which makes me think: do we need to probe all plugins here or only the ones which have the potential of being attachable ? If someone wants to make NFS attachable in the future they can add a line here and properly construct a configuration 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 could go either way. I hate this code, the plugin initialization mechanism needs to be redesigned... someday. I'll reduce this to: gce, aws, cinder, and flex.
selfCreatedPodInformer = true | ||
} | ||
if nodeInformer == nil { | ||
nodeInformer = informers.CreateSharedNodeIndexInformer(kubeClient, resyncPeriod) | ||
selfCreatedNodeInformer = true | ||
} | ||
if pvcInformer == 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.
Is there a legitimate reason to ever pass nil to this function? I dislike this pattern, and I'd rather not have the fallback
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.
Agreed it's ugly. It would be passed in nil
for testing, but we could move this responsibility to the test. Will remove it.
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.
6303cf9
to
523a541
Compare
probably should squash before commit |
Yep, will squash on LGTM. Just wanted to make it easy to see the diffs for code review. |
LGTM - just make sure not to lose track of the follow-up work. |
I've got a list =) |
Split controller cache into actual and desired state of world. Controller will only operate on volumes scheduled to nodes that have the "volumes.kubernetes.io/controller-managed-attach" annotation.
523a541
to
92500a2
Compare
Setting priority to P2 to bump in the submit queue, other 1.3 work is dependent on this. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 92500a2. |
Automatic merge from submit-queue |
This PR adds the meat of the attach/detach controller proposed in #20262.
The PR splits the in-memory cache into a desired and actual state of the world.