Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a PriorityClass in Kubernetes?
A PriorityClass is a Kubernetes resource that defines the priority level for pods. It helps the system decide which pods to schedule or evict first when resources are limited.
Click to reveal answer
intermediate
How does Kubernetes use PriorityClasses during resource contention?
Kubernetes schedules pods with higher priority classes before lower priority ones. If resources run out, it evicts lower priority pods first to make room for higher priority pods.
Click to reveal answer
beginner
What is the significance of the 'value' field in a PriorityClass?
The 'value' field is a number that defines the priority level. Higher numbers mean higher priority. For example, a PriorityClass with value 1000 is more important than one with 500.
Click to reveal answer
intermediate
Can you create a PriorityClass for a critical workload? What key fields must it include?
Yes. A PriorityClass must include: metadata.name (unique name), value (priority number), and optionally description and globalDefault (if it should be default).
Click to reveal answer
beginner
What happens if a pod does not specify a PriorityClass?
If a pod does not specify a PriorityClass, it gets the default priority, which is usually zero or the globalDefault PriorityClass if set. It will be scheduled and evicted with lower priority compared to pods with higher PriorityClasses.
Click to reveal answer
What does a higher 'value' in a PriorityClass mean?
AHigher priority for scheduling and eviction decisions
BLower priority for scheduling
CNo effect on pod scheduling
DOnly affects pod labels
✗ Incorrect
Higher 'value' means the pod is more important and gets scheduled first or evicted last.
Which pods are evicted first when the node runs out of resources?
APods with the lowest PriorityClass value
BPods with the highest PriorityClass value
CPods with the most CPU usage
DPods created last
✗ Incorrect
Pods with lower priority are evicted first to free resources for higher priority pods.
What is the purpose of the 'globalDefault' field in a PriorityClass?
AMakes the PriorityClass apply only to global pods
BMarks this PriorityClass as the default for pods without a specified priority
CDisables the PriorityClass
DSets the priority to zero
✗ Incorrect
'globalDefault: true' means pods without a PriorityClass get this priority by default.
How do you assign a PriorityClass to a pod?
AUse an annotation 'priority-class' on the pod
BSet a label 'priorityClass' on the pod
CSpecify 'priorityClassName' in the pod spec
DPriorityClass is assigned automatically
✗ Incorrect
Pods specify the PriorityClass by setting 'priorityClassName' in their spec.
What happens if two pods have the same PriorityClass value?
ABoth pods are scheduled simultaneously always
BPods with the same value are evicted immediately
CPods with the same value cannot exist
DKubernetes uses other factors like creation time to decide scheduling
✗ Incorrect
If priorities are equal, Kubernetes uses other criteria like creation time or resource requests.
Explain how PriorityClasses help Kubernetes manage critical workloads during resource shortages.
Think about how Kubernetes decides which pods to keep or remove when resources are tight.
You got /4 concepts.
Describe the steps to create and use a PriorityClass for a critical workload pod.
Focus on resource creation and pod specification.
You got /4 concepts.
Practice
(1/5)
1. What does a higher value in a Kubernetes PriorityClass mean?
easy
A. The pod will be scheduled on nodes with more memory.
B. The pod will use less CPU resources.
C. The pod has a higher priority and is more important.
D. The pod will restart automatically on failure.
Solution
Step 1: Understand PriorityClass value meaning
In Kubernetes, the value field in a PriorityClass defines the importance of the pod. Higher values mean higher priority.
Step 2: Relate priority to pod importance
Pods with higher priority are considered more critical and get scheduled before lower priority pods.
Final Answer:
The pod has a higher priority and is more important. -> Option C
Quick Check:
Higher value = higher priority [OK]
Hint: Higher PriorityClass value means more important pod [OK]
Common Mistakes:
Confusing priority with resource limits
Thinking priority controls pod restart behavior
Assuming priority affects node selection by memory
2. Which of the following is the correct YAML snippet to define a PriorityClass named high-priority with value 1000 and globalDefault: false?
Hint: Check if PriorityClass resource is applied when globalDefault fails [OK]
Common Mistakes:
Assuming pods need priorityClassName despite globalDefault
Setting globalDefault on PriorityClass with value 0
Believing globalDefault only applies to DaemonSets
5. You want to ensure that all pods without a specified PriorityClass get a default priority of 500, but also have a critical class with priority 2000. Which YAML snippet correctly sets this up?