0
0
Kubernetesdevops~20 mins

Taints and tolerations in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Taints and Tolerations Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the effect of a NoSchedule taint

What happens when a node has a taint with effect=NoSchedule and a pod does not have a matching toleration?

AThe pod will not be scheduled on the node until it has a matching toleration.
BThe pod will be scheduled but evicted immediately after starting.
CThe pod will be scheduled on the node regardless of the taint.
DThe pod will be scheduled only if the node has enough resources.
Attempts:
2 left
💡 Hint

Think about what NoSchedule means for pod placement.

💻 Command Output
intermediate
2:00remaining
Output of kubectl describe node with taints

What is the output of kubectl describe node node1 if the node has a taint key=example, value=reserved, effect=NoSchedule?

Kubernetes
kubectl describe node node1
ATaints: example=reserved:NoExecute
BTaints: example=reserved:NoSchedule
CTaints: example:NoSchedule
DTaints: None
Attempts:
2 left
💡 Hint

Check the format of taints in the node description.

Configuration
advanced
3:00remaining
Correct toleration YAML for NoExecute taint

Which YAML snippet correctly adds a toleration for a NoExecute taint with key special and value true?

A
tolerations:
- key: "special"
  operator: "Equal"
  value: "false"
  effect: "NoExecute"
B
tolerations:
- key: "special"
  operator: "Exists"
  effect: "NoExecute"
  tolerationSeconds: 300
C
tolerations:
- key: "special"
  value: "true"
  effect: "NoSchedule"
D
tolerations:
- key: "special"
  operator: "Equal"
  value: "true"
  effect: "NoExecute"
  tolerationSeconds: 300
Attempts:
2 left
💡 Hint

Remember that NoExecute tolerations can specify tolerationSeconds to limit eviction time.

Troubleshoot
advanced
3:00remaining
Pod not scheduled despite toleration present

A pod has a toleration for a taint key=zone, value=west, effect=NoSchedule but is still not scheduled on the node with that taint. What could be the reason?

AThe toleration's operator is 'Exists' but the taint has a value, so it does not match.
BThe pod's toleration effect is 'NoExecute' instead of 'NoSchedule'.
CThe toleration's value does not match the taint's value exactly.
DThe node is out of CPU resources.
Attempts:
2 left
💡 Hint

Check if the toleration's value matches the taint's value exactly.

Best Practice
expert
3:00remaining
Choosing the right taint effect for temporary node maintenance

You want to prevent new pods from scheduling on a node temporarily for maintenance but allow existing pods to continue running. Which taint effect should you use?

ANoSchedule
BNoExecute
CPreferNoSchedule
DNoStart
Attempts:
2 left
💡 Hint

Consider the difference between preventing scheduling and evicting pods.