Skip to content
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

Move kops-controller client into its own package #14727

Merged

Conversation

justinsb
Copy link
Member

@justinsb justinsb commented Dec 5, 2022

This should allow more reuse.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/nodeup labels Dec 5, 2022
@johngmyers
Copy link
Member

I can see moving Client and dial, but I'd prefer we leave the bootstrap-specific portions of QueryBootstrap behind. Perhaps pass in a req, resp interface{}?

Possibly pass in the authenticator as well, since non-bootstrap requests will probably have a different authenticator?

@johngmyers
Copy link
Member

johngmyers commented Dec 7, 2022

Actually, req and resp should use type parameters. No need to pass in a resp.

@justinsb justinsb force-pushed the refactor_kops_controller_client branch from b7059b2 to 7fb7648 Compare December 18, 2022 20:56
@justinsb
Copy link
Member Author

I don't think we can use type parameters today with struct methods (unless you know a trick).

I'm guessing you want to not move nodeup.BootstrapRequest because of versioning skew issues? But we do have those skew issues, I think. Although maybe if we always update the control plane first, and don't bootstrap control-plane nodes, it's not a problem in practice?

This refactor is to support updating gossip to just work through kops-controller. For that I was thinking of using GRPC, because I think we want streaming support rather than polling. I could just leave the existing QueryBootstrap client/logic where it is and make this a pure GRPC client - that would work too. A bit of a code duplication for connecting, but not too bad as the GRPC interfaces are a little different anyway. Would that be better for you?

@johngmyers
Copy link
Member

I sent you a PR to remove knowledge of the request and response types. I think it would be good to make the authenticator optional and possibly passed-in per request.

I see there are two bootstrap requests to kops-controller. It would be good to consolidate them, preferably into the one that is a Task. But that is probably a different PR.

@johngmyers
Copy link
Member

johngmyers commented Dec 19, 2022

I don't want to move BootstrapRequest because I don't want that knowledge outside of nodeup. It should be obvious that only nodeup can bootstrap or authenticate as a bootstrapping instance.

If you need GRPC features, then I suppose you need GRPC. I'd prefer to keep the bootstraprequest simple if possible, so that we can reason about its security. You could probably extract the connection logic into something shared by the REST and GRPC query methods.

@justinsb
Copy link
Member Author

Thanks @johngmyers - pulled in your change :-)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 19, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 19, 2022
@k8s-ci-robot k8s-ci-robot merged commit 3f05fa4 into kubernetes:master Dec 19, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants