Config - Taints and Tolerations Flashcards

1
Q

What are Taints and Tolerations used for?

A
  • used for creating restrictions, what pods can be deployed on what nodes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When can Taints and Tolerations come in to use?

A
  • when we have nodes with certain resources meant for applications with certain needs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What kind of tolerations are default for pods?

A

no tolerations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What kind of tolerations exist?

A
  • intolerant
  • tolerant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

If we apply a taint Blue to a node, what does that mean for pods to be scheduled?

A
  • by default pods have no tolerations, therefore they cannot use the tainted node
  • only pods with a toleration to blue, would be able to be scheduled there
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where are Taints / Tolerations set?

A

Taints = nodes

Tolerations = pods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do we taint a node?

A

kubectl taint nodes node-name key=value:taint-effect

i.e.
kubectl taint nodes control-plane app=blue:NoSchedule
-> applies a blue taint

taint-effect = what happens to pods, that DO NO Tolerate this taint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the taint-effect do?

A

Specifies what happens to pods, that don’t tolerate the taint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What taint-effects exist?

A
  • NoSchedule -> pods will not be scheduled on node
  • PreferNoSchedule -> system will try to avoid placing pod on node, but not guaranteed
  • NoExecute -> pods not scheduled and existing pods on the node will be evicted if they do not tolerate the taint
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do we apply Tolerations to a pod? I.e for a tainted node with:

‘kubectl taint nodes control-plane app=blue:NoSchedule’

A

pod-yaml:

apiVersion: v1
kind: Pod
metadata:
 name:
spec:
 containers:
  - name: 
    image: 
tolerations:
	  - key: app
	    operator: Equal
			value: blue
			effect: NoSchedule
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Is a tolerant pod able to be scheduled on other nodes as well?

A

Yes. It can be scheduled on nodes, where it is Tolerant of the taint as well as nodes without Taint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you find out if a node is tainted or not?

A

kubectl describe node node-name | grep Taint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly