Scheduling Flashcards

1
Q

What’s the normal scheduling procedure for a pod that was just created trough default settings?

A

If there’s no manual nodeName within spec, the scheduler will run an algorithm to randomly select one allowed node and bind the pod to it.

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

What would happen if there’s no scheduler in place and you just created a pod?

A

The pod would be stuck in pending state.

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

When can you actually assign a pod manually to a node?

A

Before creating the pod, however its possible to reassign a running altho trough curl and binding definition.

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

How can we use labels, selectors and annotations in Kubernetes?

A

Labels are used to categorise objects, like tagging while selectors for filtering. We can then match objects together like ReplicaSet and Service do trough selector key. Annotations are a form of commenting, useful for version info, location.

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

What’s the deal with tains and tolerations in Kubernetes?

A

Taints are applied to a node and dictate what pods can be placed on them. Tolerants allow the pods to be able to match on taints according to the nodes.

As such this allowes us to control which nodes can accept which pods. But it does not guarantee which pods end up on which specific nodes since node config may differ.

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

Lets say you’re about to taint a node and need to evict the existing pods not tolerating the taint. Which of the effect would you use to accomplish this?

  • NoSchedule
  • PreferNoSchedule
  • NoExecute
A

First use the NoExecute, then the NoSchedule.

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

What’s the biggest difference between tains and tolerants when compared to node selectors?

A

Where tains and tolerants try to match nodes with pods, node selectors will match only however no support for boleans.

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

How to we apply node selectors on nodes and pods?

A

First a key=value is applied to a node, then the pod get nodeSelector with matching label applied to it.

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

Node Selector and Node Affinity are very alike but with one difference, what is it?

A

Logical conditions such as OR, NOT.

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

With Node Affinity, you have three options:
- requiredDuringSchedulingIgnoredDuringExecution
- preferredDuringSchedulingIgnoredDuringExecution:
- requiredDuringSchedulingRequiredDuringExecution
How do they differ from each other?

A

First one states that the pod rules must match, else it’ll end up in pending state. Second one prefers matching of rules but if not then the pod might still end up in a node where its operational. Third one is evicting running pods.

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

Why would you use Taints & Tolerations with Node Affinity?

A

Taints & Tolerations match nodes and pods, however does not guarantee that they end up together as pods might be placed on nodes without taints. Node Affinity on the other hand restricts pods to only be placed on logical conditions.

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