What is the main purpose of defining a PriorityClass in Kubernetes?
Think about how Kubernetes decides which pods to keep or evict under resource pressure.
PriorityClass assigns a priority number to pods. Higher priority pods are scheduled first and evicted last during resource shortages.
What is the output of the command kubectl get priorityclass if you have two priority classes named high-priority with value 1000 and low-priority with value 100?
Check the order and values of priority classes as listed by kubectl.
The output lists priority classes by name alphabetically with their correct values and descriptions.
Which YAML snippet correctly defines a PriorityClass named critical with a value of 100000 and sets it as the global default?
Remember that value is a top-level field, not under spec, and globalDefault must be true to set default.
The PriorityClass resource requires value and globalDefault as top-level fields. The value must be an integer, and setting globalDefault: true makes it the default priority.
A pod with PriorityClass critical is stuck in Pending state. The cluster has resource pressure and other pods with lower priority are running. What is the most likely cause?
Check if the PriorityClass exists and is spelled correctly.
If the PriorityClass is not defined, the pod cannot be scheduled because Kubernetes cannot assign the priority, causing it to remain pending.
When assigning PriorityClass values for critical workloads, which practice is best to ensure proper scheduling and eviction behavior?
Think about how Kubernetes uses priority values to decide which pods to evict first.
Using clearly separated priority values helps Kubernetes decide which pods to evict under resource pressure, protecting critical workloads effectively.