CKA · Question #59
Perform the following tasks: Create a new PriorityClass named high-priority for user-workloads with a value that is one less than the highest existing user-defined priority class value. Patch the…
This question tests your ability to manage Kubernetes PriorityClass resources and apply them to existing workloads via Deployment patches. It requires inspecting existing cluster state before creating new objects to ensure correct relative priority values.
Question
Explanation
This question tests your ability to manage Kubernetes PriorityClass resources and apply them to existing workloads via Deployment patches. It requires inspecting existing cluster state before creating new objects to ensure correct relative priority values.
Approach. First, run kubectl get priorityclasses (or kubectl get pc) to list all existing PriorityClasses and identify the highest user-defined value - exclude system-reserved classes like system-cluster-critical (2000000000) and system-node-critical (2000001000). Create the new PriorityClass with value set to exactly one less than that highest user value using a YAML manifest or kubectl create priorityclass high-priority --value=<N-1>. Finally, patch the Deployment with kubectl patch deployment busybox-logger -n priority -p '{"spec":{"template":{"spec":{"priorityClassName":"high-priority"}}}}' - this triggers a rolling update so pods are rescheduled with the new priority.
Concept tested. Kubernetes Pod Priority and Preemption - specifically, creating and ordering PriorityClass objects (scheduling.k8s.io/v1) relative to existing ones, and wiring a PriorityClass to a Deployment via the pod spec's priorityClassName field.
Reference. https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
Topics
Community Discussion
No community discussion yet for this question.