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

kubelet - node labels command line option #17265

Merged
merged 1 commit into from
Nov 24, 2015

Conversation

gambol99
Copy link
Contributor

  • adding the -node-label flag to the kubelet which allows for a initial tagging / labeling of the node on cluster registration
  • the labels can come from a series of key=pair value or file:///path_to_file which contains key pairs

@k8s-bot
Copy link

k8s-bot commented Nov 14, 2015

Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist")

If this message is too spammy, please complain to ixdy.

1 similar comment
@k8s-bot
Copy link

k8s-bot commented Nov 14, 2015

Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist")

If this message is too spammy, please complain to ixdy.

@k8s-github-robot
Copy link

Labelling this PR as size/L

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 14, 2015
@gambol99 gambol99 force-pushed the rj/node_labels branch 2 times, most recently from 507e7ab to ae196e1 Compare November 14, 2015 00:29
if len(kl.nodeLabels) > 0 {
labels, err := kl.retrieveNodeLabels(kl.nodeLabels)
if err != nil {
return nil, fmt.Errorf("failed to apply the node labels, %s", err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should probably change this to reference --node-label in the error message as not to cause any confusion

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, please do that.

@brendandburns
Copy link
Contributor

@dchen1107 fyi

this looks totally reasonable to me. Two things need fixing:

separate --node-labels and --node-labels-file

and

think about using an existing file format rather than inventing your own.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2015
…al tagging / labelling of the node on cluster registration

- the labels can come from a series of key=pair value or file:///path_to_file which contains key pairs
@gambol99
Copy link
Contributor Author

@brendandburns .. i've updated the PR separating into two distinct command line options and the node-labels-file can be on either yaml or json format

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 18, 2015
@brendandburns brendandburns added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 23, 2015
@brendandburns
Copy link
Contributor

LGTM. thanks for the PR!

@k8s-github-robot
Copy link

@k8s-bot ok to test

pr builder appears to be missing, activating due to 'lgtm' label.

@k8s-github-robot
Copy link

Continuous integration appears to have missed, closing and re-opening to trigger it

@k8s-bot
Copy link

k8s-bot commented Nov 23, 2015

GCE e2e test build/test passed for commit c2526c9.

@k8s-github-robot
Copy link

The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label?

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Nov 24, 2015

GCE e2e test build/test passed for commit c2526c9.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Nov 24, 2015

GCE e2e test build/test passed for commit c2526c9.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@eparis
Copy link
Contributor

eparis commented Nov 24, 2015

@ixdy The bot is stuck in a loop because e2e is taking more than 60 minutes...

@wojtek-t
Copy link
Member

@eparis - this is not true
The bot stuck because something like lack of quota on github.
Log from merge-bot:

E1124 13:00:30.925418       1 github.go:63] Ran out of github API tokens. Sleeping for 46.884576439233335 minutes
E1124 13:02:11.925046       1 github.go:63] Ran out of github API tokens. Sleeping for 45.201249328816665 minutes

@k8s-bot
Copy link

k8s-bot commented Nov 24, 2015

GCE e2e test build/test passed for commit c2526c9.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

k8s-github-robot pushed a commit that referenced this pull request Nov 24, 2015
@k8s-github-robot k8s-github-robot merged commit 683e908 into kubernetes:master Nov 24, 2015
@eparis
Copy link
Contributor

eparis commented Nov 24, 2015

@wojtek-t seems like you are right, but I thought the bot would avoid this situation. I'll look today. In any case, I can't imagine how the bot would use up all 5000 tokens within 13 minutes. This probably isn't the PR to discuss it though...

@wojtek-t
Copy link
Member

@eparis - I don't know what happened, but it seems it did it. Thanks for looking into it!

@vishh
Copy link
Contributor

vishh commented Dec 8, 2015

@gambol99: Can you explain why you introduced two new modes instead of just one? Why not support just file based labels?
cc @dchen1107 @pwittrock @mikedanese @madhusudancs

@mikedanese
Copy link
Member

We previously had significant discussion on this feature including a design doc AND an implementation (see #13524) in which we decided to put this feature off. There are issues with this implementation that we need to fix before this makes it into a release or we need to revert this. Unfortunately @dchen1107 missed this and it didn't get the proper audience. In the future we should cc @kubernetes/goog-node for changes to the kubelet API.

@gambol99
Copy link
Contributor Author

gambol99 commented Dec 8, 2015

@vishh "Can you explain why you introduced two new modes instead of just one? Why not support just file based labels?" ... originally it was one option which supported both via -node-label (key=pair|file:///path) which was rejected, rightly so perhaps ... As for why? ... nothing magically, it wasn't a big stretch to support both and it leaves the choice to the user.

@gambol99
Copy link
Contributor Author

gambol99 commented Dec 8, 2015

@mikedanese is haven't gone through #13524 completely but this is somewhat different, introducing labels/files on host and periodically syncing these labels which would difficult to update and may trip people up. The option of using a pod doesn't sound too appealingly to me, i have to create a token and limit by a auth policy (i "believe" it supported resource 'node', not sure) or use a service account which unless things have changed doesn't yet support token policy, so free for all. Then push a container, write some logic to label and sleep if static, not relabel if restarted, if required etc and have a pod "inside" my cluster start labeling infrastructure outside it, all to add what in 90% of most use case's would be static labels to a node.

@vishh
Copy link
Contributor

vishh commented Dec 8, 2015

@gambol99: Ownership of node labels isn't explicit in k8s as of now. Since we have multiple sources of labels (kube API, kubelet internal plugins, host files, command line flags), it introduces ownership and priority issues. Kubelet, cannot handle labels updates and deletions gracefully. Exposing dynamic labels from kubelet isn't fully supported in k8s as of now.

I think that a localhost file should solve most of the use cases. Why do we need a command line option as well? In the future, we want to support only one mechanism for labels and that might be either file based or an exec based plugin model.

Unless we can some one fix the node labels handling before the next release, this PR will have to be reverted.

@mml
Copy link
Contributor

mml commented Dec 8, 2015

I think that a localhost file should solve most of the use cases. Why do we need a command line option as well?

I can think of a few examples. One is where the label file referenced is constantly overwritten by some outside system or pulled from a read-only filesystem, and for debugging purposes you want to add or modify a label. The flag that lets you specify an arbitrary number of additional labels on the command line makes that easy.

@vishh
Copy link
Contributor

vishh commented Dec 8, 2015

@mml: #18394 is the reason why I'm weary of adding multiple modes for setting labels.

@gambol99
Copy link
Contributor Author

gambol99 commented Dec 9, 2015

@vishh ... i'll raise another PR referencing this, drop the command line option and retain the local file only ...

@mml
Copy link
Contributor

mml commented Dec 9, 2015

i'll raise another PR referencing this, drop the command line option and retain the local file only

I don't think that solves all the problems with this implementation. For example, if I remove a label from the file (or the command line), will that label ever be removed?

@vishh
Copy link
Contributor

vishh commented Dec 9, 2015

@mml: Take a look at this comment -
#18439 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet