kubectl taint

, Pod

Syntax

kubectl taint nodes <node-name> <key>=<value>:<effect> [flags]

Parameters

ParametersDescriptionExamplesLevel
NoSchedule New Pod kubectl taint nodes node1 gpu=true:NoSchedule Common
PreferNoSchedule , kubectl taint nodes node1 load=high:PreferNoSchedule Advanced
NoExecute Pod New Pod kubectl taint nodes node1 maintenance=true:NoExecute Advanced
<key>- (key:effect ) kubectl taint nodes node1 gpu=true:NoSchedule- Common

Examples

kubectl taint nodes worker-1 dedicated=gpu:NoSchedule
Pod

kubectl taint nodes worker-1 dedicated=gpu:NoSchedule-
-

kubectl taint nodes worker-1 maintenance=true:NoExecute
Pod New

GPU

kubectl taint nodes gpu-node-1 nvidia.com/gpu=present:NoSchedule
GPU GPU

Common Errors

taint not foundkey, value, effect
node not found, kubectl get nodes

Tips

Related Commands