Improve Taints and Tolerations example
This commit is contained in:
@@ -32,15 +32,15 @@ You add a taint to a node using [kubectl taint](/docs/reference/generated/kubect
|
|||||||
For example,
|
For example,
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl taint nodes node1 key=value:NoSchedule
|
kubectl taint nodes node1 key1=value1:NoSchedule
|
||||||
```
|
```
|
||||||
|
|
||||||
places a taint on node `node1`. The taint has key `key`, value `value`, and taint effect `NoSchedule`.
|
places a taint on node `node1`. The taint has key `key1`, value `value1`, and taint effect `NoSchedule`.
|
||||||
This means that no pod will be able to schedule onto `node1` unless it has a matching toleration.
|
This means that no pod will be able to schedule onto `node1` unless it has a matching toleration.
|
||||||
|
|
||||||
To remove the taint added by the command above, you can run:
|
To remove the taint added by the command above, you can run:
|
||||||
```shell
|
```shell
|
||||||
kubectl taint nodes node1 key=value:NoSchedule-
|
kubectl taint nodes node1 key1=value1:NoSchedule-
|
||||||
```
|
```
|
||||||
|
|
||||||
You specify a toleration for a pod in the PodSpec. Both of the following tolerations "match" the
|
You specify a toleration for a pod in the PodSpec. Both of the following tolerations "match" the
|
||||||
@@ -49,15 +49,15 @@ to schedule onto `node1`:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tolerations:
|
tolerations:
|
||||||
- key: "key"
|
- key: "key1"
|
||||||
operator: "Equal"
|
operator: "Equal"
|
||||||
value: "value"
|
value: "value1"
|
||||||
effect: "NoSchedule"
|
effect: "NoSchedule"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tolerations:
|
tolerations:
|
||||||
- key: "key"
|
- key: "key1"
|
||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoSchedule"
|
effect: "NoSchedule"
|
||||||
```
|
```
|
||||||
@@ -80,7 +80,7 @@ There are two special cases:
|
|||||||
An empty `key` with operator `Exists` matches all keys, values and effects which means this
|
An empty `key` with operator `Exists` matches all keys, values and effects which means this
|
||||||
will tolerate everything.
|
will tolerate everything.
|
||||||
|
|
||||||
An empty `effect` matches all effects with key `key`.
|
An empty `effect` matches all effects with key `key1`.
|
||||||
|
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user