k8s part 3 Flashcards

1
Q

what are daemon sets in k8s?

A

DaemonSets are a feature in Kubernetes that ensures a copy of a specific pod runs on all (or some) nodes in a cluster. eg if you want a copy of an antivirus to run on all your nodes, daemon sets will get that done.

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

what is a node selector?

A

a node selector is a simple way to constrain which nodes your pod can be scheduled on. It’s essentially a filter based on the labels assigned to nodes.

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

you can add labels to nodes T or F

A

T

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

what is the command to label a node ?

A

kubectl label node [node name] key=value

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

what field in the YAML file makes sure a port is scheduled on a specific node?

A

nodeSelector

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

nodes in k8s come with some default labels T or F

A

T

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

what is node affinity?

A

Node affinity in Kubernetes is an advanced way to control which nodes your pods are scheduled on, similar to node selectors but with more flexibility

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

what are the two types of node affinity?

A

Required During Scheduling, Ignored During Execution: This is a hard requirement. If the rule is not met, the pod won’t be scheduled.

Preferred During Scheduling, Ignored During Execution: This is a soft preference. The scheduler will try to place the pod on a node that meets the rule, but if no such node is available, the pod can still be scheduled elsewhere

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

what are the different kinds of operators we can use for node affinity?

A

You can use the operator field to specify a logical operator for Kubernetes to use when interpreting the rules. You can use In, NotIn, Exists, DoesNotExist, Gt and Lt

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

what is resource limits in k8s?

A

Resource limits in Kubernetes are used to control the amount of compute resources (CPU and memory) that a container can use

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

what are requests ?

A

Requests: This is the amount of CPU and memory that a container is guaranteed to get. The Kubernetes scheduler uses these values to decide which node to place the pod on. If a node has enough available resources to meet the request, the pod will be scheduled there.

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

what are limits?

A

Limits: This is the maximum amount of CPU and memory that a container is allowed to use. If a container tries to use more than the limit, it will be throttled (in the case of CPU) or terminated (in the case of memory).

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

if your pod requires 10GB of RAM and there is no node with that capacity of RAM , will the pod still run? Y or N?

A

N

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

what is quality of service?

A

Quality of Service (QoS) classes are used to manage how resources are allocated to pods.

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

what are the three classes of Quality of service? (QOS)

A
  • guaranteed : A pod is classified as Guaranteed if every container in the pod has both memory and CPU resource requests and limits set, and the request is equal to the limit. Usage: Ideal for critical applications that need guaranteed resources and cannot tolerate interruptions.
  • Burstable: A pod is classified as Burstable if it has memory and/or CPU requests set, but the requests do not match the limits Usage: Suitable for applications that can tolerate some variation in resource availability but still need certain guarantees.
  • Best Effort: A pod is classified as Best Effort if none of its containers have memory or CPU requests or limits set. These pods have the lowest priority. usage: Suitable for non-critical applications that can tolerate being interrupted or evicted when the node runs out of resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

which QOS class eats the most memory?

A

best effort

17
Q

in case of lack of resources which QOS class will be killed last?

A

guaranteed