All Products
Search
Document Center

Container Service for Kubernetes:Enable preemption

Last Updated:Dec 16, 2025

When resources in a cluster become insufficient, high-priority tasks may fail to run. After you enable preemption, ACK Scheduler can determine and evict low-priority pods through resource simulation, releasing computing resources to launch high-priority pods.

Preemption policies

The following list describes the procedure of preemption:

  1. Specify the task priority: Add the priorityClassName parameter to the pod configurations to declare the priority of the pod.

    System components (such as kube-proxy and etcd) are typically associated with the system-node-critical PriorityClass, which assigns a high priority. Most system components are deployed as DaemonSets, which are not evicted by default.
  2. Simulate preemption when resources become insufficient: When detecting a pending task that fails to be scheduled due to insufficient resources, ACK Scheduler simulates whether certain low-priority tasks can be shut down to release sufficient resources for high-priority tasks.

  3. Securely evict low-priority tasks: After ACK Scheduler triggers the preemption logic, the kubelet evicts low-priority pods from the node in a secure manner according to system instructions, releasing sufficient resources to complete the scheduling of high-priority tasks.

  4. Reschedule low-priority tasks: Evicted low-priority pods will be recreated by the their controllers, such as Deployments, and scheduled to other nodes. If resources in the cluster are still insufficient, the pods remain pending.

ACK Scheduler supports the following preemption policies by default. You can manage and configure them by using the PreemptionAlgorithm parameter.

Policy

Description

Default

The default preemption policy of Kubernetes. When this policy is used, ACK Scheduler first attempts direct scheduling. When resources are insufficient, ACK Scheduler simulates resource preemption to determine the low-priority pods to evict in order to release sufficient resources for scheduling high-priority pods. For more information, see Pod priority and preemption.

ElasticQuota

Performs preemption based on the ElasticQuotaTree.

  1. Identify the preemption list: Unlike regular tasks, ACK Scheduler combines all pending pods of the entire gang into a preemption list. The entire gang is processed only when all pods in the list can be scheduled through resource preemption. If one pod cannot be scheduled, the gang is not processed. If any pod in the gang is assigned a high priority, the entire gang is considered high-priority for resource preemption.

  2. Generate a list of feasible nodes: ACK Scheduler further determines which nodes will be selected based on the following rules:

    • If multiple pods in the gang need preemption, nodes that match one of the pods, the node is added to the candidate pool. Then, ACK Scheduler attempts to free up resources for other pods.

    • If only one pod needs preemption, ACK Scheduler filters out nodes that have been marked as Unschedulable to accurately locate nodes with insufficient or mismatched resources.

  3. Simulate preemption: ACK Scheduler attempts to simulate preemption by filtering out pods eligible for preemption from nodes in the preceding list of feasible nodes based on the following conditions:

    • Pods that are not being preempted by other pods or tasks.

    • Pods that can be evicted according to the relevant PodDisruptionBudgets (PDBs).

    Then, ACK Scheduler proceeds based on the ElasticQuotaTree configured in the cluster in different scenarios:

    • The preempting pod belongs to a Quota:

      • If Quota usage ≤ its Min guarantee: The Quota has not yet met its minimum resource guarantee. The pod is allowed to preempt pods from other Quotas that are currently using resources above their Min guarantee.

      • If Quota usage > its Min guarantee: The pod is only allowed to preempt lower-priority pods within its own Quota (this is known as intra-quota preemption).

    • The preempting pod does not belong to any Quota: Preemption is not allowed.

    After filtering out the pods to be preempted, ACK Scheduler simulates removing these pods and scheduling the preempting pod. If the simulation result indicates successful scheduling, the preempted pods will be securely evicted and rescheduled to other nodes. If the simulation result indicates failed scheduling, the preemption is terminated.

Auto

Adjusts the preemption policy based on cluster configurations. Simply put, ACK Scheduler prioritizes the ElasticQuota policy and automatically changes to the Default policy when the ElasticQuota policy does not take effect.

None

Disables the preemption capability. In this case, no preemption behavior occurs in the cluster.

When the preemption capability is enabled, the preemption policy takes effect according to the logic described in the following figure.

image

Enable preemption

Before you enable preemption, we recommend that you read Pod priority and preemption to understand the related terms.

You can customize scheduler parameters by configuring the preemptionAlgorithm parameter to enable preemption. The default preemption policy is Auto.