improve Taints and Tolerations example (zh)

This commit is contained in:
Arhell
2020-11-27 01:03:28 +02:00
parent a0560f3c62
commit 8388ca4593
@@ -45,11 +45,11 @@ For example,
您可以使用命令 [kubectl taint](/docs/reference/generated/kubectl/kubectl-commands#taint) 给节点增加一个污点。比如, 您可以使用命令 [kubectl taint](/docs/reference/generated/kubectl/kubectl-commands#taint) 给节点增加一个污点。比如,
```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.
```shell ```shell
@@ -58,7 +58,7 @@ kubectl taint nodes node1 key:NoSchedule
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:NoSchedule- kubectl taint nodes node1 key1=value1:NoSchedule-
``` ```
--> -->
给节点 `node1` 增加一个污点,它的键名是 `key`,键值是 `value`,效果是 `NoSchedule` 给节点 `node1` 增加一个污点,它的键名是 `key`,键值是 `value`,效果是 `NoSchedule`
@@ -81,15 +81,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"
``` ```
@@ -123,7 +123,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 >}}
存在两种特殊情况: 存在两种特殊情况: