<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Taint和Toleration(污點和容忍) Taint(污點)和 Toleration(容忍)可以作用于 node 和 pod 上,其目的是優化 pod 在集群間的調度,這跟節點親和性類似,只不過它們作用的方式相反,具有 taint 的 node 和 pod 是互斥關系,而具有節點親和性關系的 node 和 pod 是相吸的。另外還有可以給 node 節點設置 label,通過給 pod 設置 `nodeSelector` 將 pod 調度到具有匹配標簽的節點上。 Taint 和 toleration 相互配合,可以用來避免 pod 被分配到不合適的節點上。每個節點上都可以應用**一個或多個** taint ,這表示對于那些不能容忍這些 taint 的 pod,是不會被該節點接受的。如果將 toleration 應用于 pod 上,則表示這些 pod 可以(但不要求)被調度到具有相應 taint 的節點上。 ## 示例 以下分別以為 node 設置 taint 和為 pod 設置 toleration 為例。 ## 為 node 設置 taint 為 node1 設置 taint: ```bash kubectl taint nodes node1 key1=value1:NoSchedule kubectl taint nodes node1 key1=value1:NoExecute kubectl taint nodes node1 key2=value2:NoSchedule ``` 刪除上面的 taint: ```bash kubectl taint nodes node1 key1:NoSchedule- kubectl taint nodes node1 key1:NoExecute- kubectl taint nodes node1 key2:NoSchedule- ``` 查看 node1 上的 taint: ```bash kubectl describe nodes node1 ``` ## 為 pod 設置 toleration 只要在 pod 的 spec 中設置 tolerations 字段即可,可以有多個 `key`,如下所示: ```yaml tolerations: - key: "key1" operator: "Equal" value: "value1" effect: "NoSchedule" - key: "key1" operator: "Equal" value: "value1" effect: "NoExecute" - key: "node.alpha.kubernetes.io/unreachable" operator: "Exists" effect: "NoExecute" tolerationSeconds: 6000 ``` - `value` 的值可以為 `NoSchedule`、` PreferNoSchedule` 或 `NoExecute`。 - `tolerationSeconds` 是當 pod 需要被驅逐時,可以繼續在 node 上運行的時間。 詳細使用方法請參考[官方文檔](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/)。 ## 參考 - [Taints and Tolerations - kuberentes.io](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看