Scheduling Flashcards

1
Q

How do you assign a pod to a node?

A

Define the nodeName configuration in the spec section of the pod manifest.

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

How do you assign a node to an existing pod?

A

You convert a YAML Binding manifest to JSON and then POST to the API. eg.

apiVersion: v1
kind: Binding
metadata:
name: nginx
target:
apiVersion: v1
kind: Node
name: node02

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

How do you get pods by specifying a label?

A

k get pods – selector <label>=<label_value></label_value></label>

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

What is the command for getting all objects in env=prod

A

k get all –selector=env=prod

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

What is the command to identify the POD which is part of the prod environment, the finance BU and of frontend tier?

A

k get pod –selector=env=prod,bu=finance,tier=frontend

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

What sets restrictions on what pods can be scheduled on a node?

A

Taints and tolerations

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

What is the command to taint a node?

A

k taint nodes <node_name> <key>=<value>:<taint></taint></value></key></node_name>

Taint can be one of the following:
- NoSchedule
- PreferNoSchedule
- NoExecute

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

What are the three types of taints?

A
  • NoSchedule
  • PreferNoSchedule
  • NoExecute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you define a toleration?

A

Inside a manifest’s spec section you define:

spec:

tolerations:
- key: “<key_name>"
operator: "Equal"
value: "<key_value>"
effect: "<taint_match>"</taint_match></key_value></key_name>

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

What is the command to label a node?

A

k label nodes <node_name> <label_key>=<label_value></label_value></label_key></node_name>

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

How do you define a nodeSelector for a pod?

A

Inside a manifest’s spec section you define:

spec:

nodeSelector:
size: <size></size>

Where size = label key value pair

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

What are the types of node affinity?

A

Available
requiredDuringSchedulingIgnoredDuringExecution
preferredDuringSchedulingIgnoredDuringExecution

Planned
requiredDuringSchedulingRequiredDuringExecution

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

What ensures that one pod is always present on all nodes in a cluster?

A

Daemon Sets

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

What kind of manifest is almost identical to the ReplicaSet or Deployment definition?

A

DaemonSet

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

How does the kubelet create a static pod?

A

By placing a manifest in the pod-manifest-path directory

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

Can multiple copies of a scheduler running at the same time?

A

No. The leaderElection section of a manifest can define what scheduler is the leader.

17
Q

How do you define what scheduler should be used by a pod?

A

spec:

schedulerName: <scheduler_name></scheduler_name>

18
Q

What happens if you create a pod that defines using a scheduler that is not properly configured?

A

The pod will remain in a pending state

19
Q

How do you know what scheduler picked up scheduling a pod?

A

k get events -o wide

20
Q

How do you create seperate profiles for each scheduler using the same binary?

A

Define the schdulerName under the profiles section. eg.

profiles:
- schedulerName: my-scheduler-2
- schedulerName: my-scheduler-3
- schedulerName: my-scheduler-4

21
Q

How do you disable or enable plugins for schedulers?

A

profiles:
- schedulerName: my-scheduler-2
plugins:
score:
disabled:
- name: TaintToleration
enabled:
- name: MyCustomPluginA
- name: MyCustomPluginB
- schedulerName: my-scheduler-3
plugins:
prescore:
disabled:
- name: ‘
score:
enabled:
- name: ‘

- schedulerName: my-scheduler-4

22
Q

How do you define a priority class?

A

apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 1000000
globalDefault: false
description: “This should be used to XYZ service pods only”

23
Q

How do you define a priority class on a pod manifest

A

Add the priorityClassName: <priority_name> to the spec section. eg.

spec:
priorityClassName: <priority_name></priority_name>