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

Add an example of how to attach labels to nodes and use nodeSelectors so... #4088

Merged
merged 1 commit into from
Feb 4, 2015

Conversation

a-robinson
Copy link
Contributor

... that pods can be scheduled on specific nodes.

@a-robinson
Copy link
Contributor Author

Issue #2406

@@ -0,0 +1,120 @@
## Node selection example
Copy link
Contributor

Choose a reason for hiding this comment

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

We'd also mention that pinging pod to specific machine using this approach is discouraged. This is a scheduling problem, not something user needs to take care of. The plan is to add more resource type for node, and more resource requirement for pod.

@a-robinson
Copy link
Contributor Author

Thanks for the review! I've fixed up everything you mentioned.

@brendandburns
Copy link
Contributor

LGTM, personally, I would soften the language around "discouraged" to be something like "generally this is unnecessary, as the scheduler will take care of it for you, but in certain circumstances like ..."

@a-robinson
Copy link
Contributor Author

Sounds good, done.


### Step One: Attach label to the node

Run `kubectl get nodes` to get the names of the nodes. Pick out the one that you want to add a label to. Note that label keys must be in the form of DNS labels (as described in the [identifiers doc](/docs/design/identifiers.md), meaning that they are not allowed to contain any upper-case letters. Then run `kubectl get node <node-name> -o yaml > node.yaml`. The contents of the file should look something like this:
Copy link
Contributor

Choose a reason for hiding this comment

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

closing paraen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doh! fixed

@ddysher
Copy link
Contributor

ddysher commented Feb 4, 2015

LGTM one minor comment

@ddysher ddysher self-assigned this Feb 4, 2015
… so that pods can be scheduled on specific nodes.
a-robinson added a commit that referenced this pull request Feb 4, 2015
Add an example of how to attach labels to nodes and use nodeSelectors so...
@a-robinson a-robinson merged commit a053dbc into kubernetes:master Feb 4, 2015
@a-robinson a-robinson deleted the nodelabels branch February 7, 2015 00:50
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.

3 participants