Taints and tolerations are used to set restrictions on what pods can be scheduled on a node. Taints are set on nodes, tolerations - on pods.
To taint a node:
kubectl taint nodes node-name key=value:taint-effect
kubectl taint nodes node1 app=blue:NoSchedule
the taint-effect defines what will happen to the pods if they do not tolerate the taint:
kubectl taint nodes node-name key=value:taint-effect-
Tolerations are added to pods inside spec.tolerations of the Pod definition:
spec:
tolerations:
- key: "app"
operator: "Equal"
value: "blue"
effect: "NoSchedule"
kubectl describe node master | grep Taint