0
0
Kubernetesdevops~5 mins

Taints and tolerations in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a taint in Kubernetes?
A taint is a property applied to a node that prevents pods from being scheduled on it unless those pods have matching tolerations.
Click to reveal answer
beginner
What does a toleration do in Kubernetes?
A toleration allows a pod to be scheduled on a node that has matching taints, effectively 'tolerating' the taint.
Click to reveal answer
intermediate
Explain the effect field in a taint.
The effect field defines what happens to pods that do not tolerate the taint. Common effects are NoSchedule (don't schedule), PreferNoSchedule (try not to schedule), and NoExecute (evict existing pods).
Click to reveal answer
intermediate
How do taints and tolerations help in node management?
They help control which pods can run on which nodes, allowing separation of workloads, reserving nodes for special tasks, or isolating nodes for maintenance.
Click to reveal answer
beginner
Give an example of a taint command to prevent pods without tolerations from scheduling on a node named 'worker1'.
kubectl taint nodes worker1 key=value:NoSchedule
Click to reveal answer
What happens if a node has a taint but a pod does not have a matching toleration?
AThe pod will ignore the taint and run.
BThe pod will be scheduled on that node anyway.
CThe pod will be deleted immediately.
DThe pod will not be scheduled on that node.
Which effect in a taint causes existing pods without tolerations to be evicted from the node?
ANoExecute
BPreferNoSchedule
CNoSchedule
DEvict
How do you remove a taint from a node named 'node1' with key 'key1' and value 'value1'?
Akubectl taint nodes node1 key1=value1:NoSchedule-
Bkubectl remove taint node1 key1=value1
Ckubectl delete taint node1 key1=value1
Dkubectl clear taint node1 key1=value1
Which command adds a toleration to a pod spec?
Akubectl add toleration pod
BAdd tolerations field in pod YAML under spec
Ckubectl taint pod
Dkubectl tolerate pod
What is the main purpose of using taints and tolerations together?
ATo delete pods automatically
BTo force all pods to run on all nodes
CTo control pod scheduling on specific nodes
DTo increase pod resource limits
Describe how taints and tolerations work together to control pod scheduling in Kubernetes.
Think about how nodes can repel pods and how pods can accept that.
You got /4 concepts.
    Explain the difference between the NoSchedule and NoExecute effects in taints.
    Consider when pods are blocked or removed.
    You got /3 concepts.