Skip to content

Update the kubelet with the ability to register itself with the master.#2435

Closed
brendandburns wants to merge 1 commit intokubernetes:masterfrom
brendandburns:discovery
Closed

Update the kubelet with the ability to register itself with the master.#2435
brendandburns wants to merge 1 commit intokubernetes:masterfrom
brendandburns:discovery

Conversation

@brendandburns
Copy link
Copy Markdown
Contributor

See #2303

Comment thread cmd/kubelet/kubelet.go
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like a single flag that tells the path to a kubernetes_auth file better than calling BindClientConfigFlags because it allows clients to be portable across clusters with different auth setups, and facilitates rotating credentials. Consider replacing client.BindClientConfigFlags with:

import  "github.com/GoogleCloudPlatform/kubernetes/pkg/clientauth"
...
vars(
    authPath                = flag.String("auth_path", "", "Path to .kubernetes_auth file, specifying how to authenticate to API server.")
    apiServer               = flag.String("api_server", "Kubernetes API server (ip:port)")
)
...
func getApiserverClient() (*client.Client, error) {
    authInfo, err := clientauth.LoadFromFile(*authPath)
    if err != nil {
        return nil, err
    }
    clientConfig, err := authInfo.MergeWithConfig(client.Config{})
    if err != nil {
        return nil, err
    }
    clientConfig.Host = apiServer
    if c, err := client.New(&clientConfig); err != nil {
        return nil, err
    } else {
        return c, nil
    }
}
... 
apiClient, err := getApiserverClient()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2437 is intended to make this easier and simpler to do.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest removing this line and waiting for a different PR to discuss my and Clayton's comments above. Should still be quite possible to make a client.

@erictune
Copy link
Copy Markdown
Contributor

why is it better to have kubelets send the join than to have the master or a minion controller add kubelets?

in the case where self-registration of kubelets is enabled, by what process are they de-registered?

@erictune
Copy link
Copy Markdown
Contributor

What mode of authentication do you plan to use with the kubelet's api client?

Comment thread cmd/kubelet/kubelet.go
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't these be part of the same flag? Seems like they always go together (don't need both)

@lavalamp lavalamp assigned lavalamp and erictune and unassigned lavalamp Nov 18, 2014
@jbeda
Copy link
Copy Markdown
Contributor

jbeda commented Nov 18, 2014

I'd like to suggest an alternate auth model for this:

  • We use TLS client auth for communication of the kubelet to the master. Each kubelet generates a key pair.
  • When kubelets are self-registering (which is optional) there is an open endpoint (perhaps restricted based on CIDR) where a kubelet can request to be added.
  • After the kubelet requests to be added it is in a "PENDING" state.
  • There are policies for what to do here. This would include auto-accept, manual or auto-reject. The cloud controller could also review and accept. (Auth-reject would mean that the kubelet needs to be added by a trusted user and skips the PENDING state).
  • We provide an easy set of commands in kubectl to review and accept (perhaps in bulk) pending kubelets.

Note that this flow is compatible with the thinking in #2303.

@brendandburns
Copy link
Copy Markdown
Contributor Author

As it stands, there is nothing in this PR that relates to auth. The kubelet uses the apiserver API just like anything else.

I would like to suggest that we divide the problem into two problems:

  • Discovery and registration by the kubelet (this PR)
  • Authentication of a request from the kubelet to join a cluster (some future PR)

I would really rather get this PR in, rather than block on the auth model.

(I'll fix the bugs in the code noted by @erictune shortly)

@lavalamp
Copy link
Copy Markdown
Contributor

Discovery and registration by the kubelet (this PR)

I feel like we never all got on the same page about this being our model. Should kubelets self-register? Or should our node-manager thingy register them, or an admin, all of the above, or none of the above? I don't think we have a coherent vision for this yet.

@smarterclayton
Copy link
Copy Markdown
Contributor

On Nov 18, 2014, at 5:01 PM, Daniel Smith notifications@github.com wrote:

Discovery and registration by the kubelet (this PR)

I feel like we never all got on the same page about this being our model. Should kubelets self-register? Or should our node-manager thingy register them, or an admin, all of the above, or none of the above? I don't think we have a coherent vision for this yet.

Agree. Tend to lean towards all of the above because people will want different processes around registration.


Reply to this email directly or view it on GitHub.

@brendandburns
Copy link
Copy Markdown
Contributor Author

100% all of the above. I think that some people will want to lock it down completely, some people will want to self-manage their nodes (especially at first) so they can add specific instances with SSD or whatever.

But again, this policy seems to be a property of the apiserver which is the gate keeper for deciding if they join or not, not the kubelet which simply discover's and asks to join.

We should enable the expression of these policies, but not in this PR. As it stands right now, I can dynamically add minions via the API server. This PR simply streamlines that process for the kubelet.

@bgrant0607
Copy link
Copy Markdown
Member

What problem are you trying to solve? Submitting PRs with no comments, no description, and no issue reference is not very helpful.

@brendandburns
Copy link
Copy Markdown
Contributor Author

I added some documentation (clustering.md) about the three different models I think that we should support. Let's get some agreement there.

--brendan

@brendandburns
Copy link
Copy Markdown
Contributor Author

@jbeda I'm happy to add your suggestions there, or we can merge and iterate forward.

Comment thread docs/clustering.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this doc. It explains the different options well. Would you mind either:

  • moving it to docs/design/clustering.md until we have complete support for all the options; OR
  • calling out which options are actually supported, and which aren't, as of the time of this PR being merged.

Ideally, all descriptions in the top level docs folder would be current rather than aspirational.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm willing to wait for another PR for this comment.

@erictune
Copy link
Copy Markdown
Contributor

I'm now happy with the overall direction that @brendanburns and @jbeda are suggesting. I do still have some comments on the code

Comment thread cmd/kubelet/kubelet.go
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You said that you wanted to tackle registration in this PR, and authentication in another one. That's fine by me. In that case, how about deleting line 80 above, and line 89. You can still test out this code --auth_path flag and the --api_servers flag. And then we can revisit those lines in a later PR.

Comment thread cmd/kubelet/kubelet.go
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, could we please not Fatalf here? This will be a problem in production. It would be much better to produce an error, sleep, and retry until it succeeds, while surfacing information for debugging/monitoring.

This is a case where it would be great to have the equivalent of DFATAL - die if a test, and error if production.

@kubernetes-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@davidopp
Copy link
Copy Markdown
Contributor

davidopp commented Dec 1, 2014

Where does clustering.md live now? I couldn't find it in the repo.

@erictune erictune removed their assignment Dec 6, 2014
@bgrant0607
Copy link
Copy Markdown
Member

@davidopp clustering.md hasn't been added yet, since this PR hasn't been merged.

@jbeda jbeda self-assigned this Dec 8, 2014
@jbeda
Copy link
Copy Markdown
Contributor

jbeda commented Dec 8, 2014

I'll work with @brendandburns this week to move this forward. This is a key part of our "easy clustering" story.

@erictune
Copy link
Copy Markdown
Contributor

#2793 will go nicely with this PR.

jbeda added a commit to jbeda/kubernetes that referenced this pull request Jan 7, 2015
This is related to kubernetes#2303 and steals from kubernetes#2435.
@jbeda jbeda mentioned this pull request Jan 7, 2015
@bgrant0607
Copy link
Copy Markdown
Member

@brendandburns Are you planning to pick this up again?

@erictune
Copy link
Copy Markdown
Contributor

erictune commented Mar 4, 2015

ping @brendanburns to close PR or state plan for it

@phemmer
Copy link
Copy Markdown

phemmer commented Mar 4, 2015

ping @brendanburns to close PR or state plan for it

I think that might be a bad ping. @brendanburns vs @brendandburns

@alex-mohr alex-mohr assigned dchen1107 and unassigned jbeda Mar 9, 2015
@bgrant0607
Copy link
Copy Markdown
Member

Discussed w/ @brendandburns. We're planning to do this, but not using this exact approach. Closing.

@bgrant0607 bgrant0607 closed this Mar 11, 2015
@brendandburns brendandburns deleted the discovery branch August 7, 2015 04:43
xingzhou pushed a commit to xingzhou/kubernetes that referenced this pull request Dec 15, 2016
This is related to kubernetes#2303 and steals from kubernetes#2435.
deads2k pushed a commit to deads2k/kubernetes that referenced this pull request Sep 24, 2025
…silimits

4.16: OCPBUGS-60872: UPSTREAM: 127757: scheduler: Improve CSILimits plugin accuracy by using VolumeAttachments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants