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

Improve taint and toleration documentation #5048

Merged
merged 1 commit into from
Aug 28, 2017

Conversation

tengqm
Copy link
Contributor

@tengqm tengqm commented Aug 18, 2017

This PR separates the taint and toleration subsection into its own article.
Conceptually, it doesn't fit well into the assign-pod-to-node. Instead taints are meant to be "unassign-pod-from-node".

In the new article, the builtin taints that were missing are added.

This fixes #5012

Allow edits from maintainers checkbox


This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 18, 2017
@k8sio-netlify-preview-bot
Copy link
Collaborator

k8sio-netlify-preview-bot commented Aug 18, 2017

Deploy preview ready!

Built with commit 82ca38f

https://deploy-preview-5048--kubernetes-io-master-staging.netlify.com

@chenopis
Copy link
Contributor

@tengqm How much of this is newly written content versus just being moved into a new article? If all of it is new, I will need a little more time to review it.

Node affinity is a property of *pods* that *attracts* them to a set of nodes
(either as a preference or a hard requirement).
You may want to check [Taints](/docs/concepts/configuration/taint-and-toleration/)
as well, which allow a *node* to *repel* a set of pods.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewers: Line 301-304 are new. Mainly providing an anchor to the taint-and-toleration article.

Node affinity, described [here](/docs/concepts/configuration/assign-pod-node/#node-affinity-beta-feature),
is a property of *pods* that *attracts* them to a set of nodes (either as a
preference or a hard requirement). Taints are the opposite -- they allow a
*node* to *repel* a set of pods.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewers: line 9-12 are new. They provide an anchor back to the node-affinity feature for comparison.

Taints and tolerations are a flexible way to steer pods *away* from nodes or evict
pods that shouldn't be running. A few of the use cases are

* **Dedicated Nodes**: If you want to dedicate a set of nodes for exclusive use by
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewers: "Dedicated Nodes" was "dedicated nodes"

controller should additionally add a node affinity to require that the pods can only schedule
onto nodes labeled with `dedicated=groupName`.

* **Nodes with Special Hardware**: In a cluster where a small subset of nodes have specialized
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewers: "Nodes with Special Hardware" was "nodes with special hardware".

and request it as a resource in the PodSpec, or you could label the nodes that have
the special hardware and use node affinity on the pods that need the hardware.

* **Taint based Evictions (alpha feature)**: A per-pod-configurable eviction behavior
Copy link
Contributor Author

@tengqm tengqm Aug 22, 2017

Choose a reason for hiding this comment

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

To Reviewers: "Taint based Evictions (alpha feature)" was "per-pod-configurable eviction behavior when there are node problems (alpha feature)"

This bullet was rephrased.

* `node.cloudprovider.kubernetes.io/uninitialized`: When kubelet is started
with "external" cloud provider, it sets this taint on a node to mark it
as unusable. When a controller from the cloud-controller-manager initializes
this node, kubelet removes this taint.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To Reviewers: Line 190-205 are new contents, mainly enumerating the various built-in taints supported now.

tolerationSeconds: 6000
```

(For the node not ready case, change the key to `node.alpha.kubernetes.io/notReady`.)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewers: this line was too specific in the context of more taints supported, so removed in revision.

* `node.kubernetes.io/outOfDisk` (*only for critical pods*)

This ensures that DaemonSet pods are never evicted due to these problems,
which matches the behavior when this feature is disabled.
Copy link
Contributor Author

@tengqm tengqm Aug 22, 2017

Choose a reason for hiding this comment

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

To reviewers: line 247-257 were revisions based on taints we support now. Only 'unreachable' and 'notReady' were supported before.

Copy link
Contributor Author

@tengqm tengqm left a comment

Choose a reason for hiding this comment

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

@chenopis Changes made are now highlighted for ease of review. Thanks.

@chenopis
Copy link
Contributor

@tengqm Ok, great! Thanks!

Copy link
Member

@bsalamat bsalamat left a comment

Choose a reason for hiding this comment

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

Thanks, @tengqm!
Changes look generally good to me, I only have a minor comment.
I didn't check the unchanged parts of the text.

`NoExecute` tolerations for `node.alpha.kubernetes.io/unreachable` and `node.alpha.kubernetes.io/notReady`
with no `tolerationSeconds`. This ensures that DaemonSet pods are never evicted due
to these problems, which matches the behavior when this feature is disabled.
Node affinity is a property of *pods* that *attracts* them to a set of nodes
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this line and keep the line below ("You may want to check..."). It would confuse users to see it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, will do.

@tengqm tengqm force-pushed the taint-and-toleration branch 2 times, most recently from dd17c63 to 39a595e Compare August 24, 2017 01:20
@bsalamat
Copy link
Member

/lgtm

Thanks, @tengqm!

@tengqm
Copy link
Contributor Author

tengqm commented Aug 25, 2017

/retest

@kevin-wangzefeng
Copy link
Member

/lgtm
Thanks for the improvement.

@tengqm
Copy link
Contributor Author

tengqm commented Aug 28, 2017

/retest

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 28, 2017
Copy link
Contributor

@chenopis chenopis left a comment

Choose a reason for hiding this comment

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

/docs lgtm

@chenopis chenopis merged commit 3cfaa2a into kubernetes:master Aug 28, 2017
@tengqm tengqm deleted the taint-and-toleration branch September 28, 2017 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvement to taint based eviction/toleration needed
6 participants