| 语法 | kubectl taint nodes node-1 gpu=true:NoSchedule |
|---|---|
| 删除 | kubectl taint nodes node-1 gpu=true:NoSchedule- |
| 三种效果 | NoSchedule / PreferNoSchedule / NoExecute |
| 配合 | Pod 侧 tolerations 才能落在被污点节点 |
| 常见场景 | GPU 专用节点、专属租户、节点上线前的隔离 |
使用示例
使用示例
kubectl taint nodes node-gpu-1 gpu=true:NoSchedule
kubectl describe node node-gpu-1 | grep Taints
kubectl taint nodes node-gpu-1 gpu=true:NoSchedule-看到 Pod Pending 且 describe 提示 taint 不匹配:要么给 Pod 加容忍,要么确认该节点本就该排除。