To use this feature, you (or a cluster administrator) will need to enable the EvictionRequestAPI feature gate for all relevant components in your cluster.
See Enable Or Disable Feature Gates for more information.
EvictionRequest and Eviction are API resources whose purpose is to enable graceful eviction of pods and to introduce observability into the eviction process. Several participants can coordinate the eviction of a Pod from a node.
A requester is an entity that wants the Pod to be terminated, for example node drain tooling. Each requester creates
its own EvictionRequest instance, which targets a single Pod. Because the eviction is asynchronous, the requester
should observe the TargetEvicted and Failed conditions of the EvictionRequest to learn the outcome. It can also
withdraw its eviction intent by updating the .spec.intent or by deleting the request.
The evictionrequest-controller observes EvictionRequests and ensures that the appropriate Eviction objects exist.
This mapping depends on the target and the intent of the requests, but there is at most one active Eviction per Pod.
A responder is usually a controller that knows how to terminate or move the application away safely. Responders
should register themselves in the Pod's .spec.evictionResponders. Each responder has a unique name and a priority.
Responders take turns, from the highest priority to the lowest, and report their progress in the Eviction object. If
none of the custom responders terminate the Pod, the default imperative-eviction.k8s.io/evictor responder becomes
active. It uses API-initiated eviction, which honors
PodDisruptionBudgets, and retries until the Pod is gone.
The EvictionRequest and Eviction API resources are part of the lifecycle.k8s.io/v1alpha1
API group. Your cluster must have that API group enabled, as well
as the EvictionRequestAPI feature gate for
the kube-apiserver and the kube-controller-manager, before you can use this API.
The evictionrequest-controller enforces the eviction contract between requesters and responders. It reacts to
EvictionRequests, manages the resulting Evictions, and takes every eviction through the following steps:
.spec.requester to its identifier, which is a domain name followed
by a key (for example node-maintenance.example.com/drainer), .spec.target.pod to the name and UID of the Pod, and
.spec.intent to Eviction.Failed..spec.target.pod, or reuses the active one if another requester
already asked for the same Pod. It initializes the status of the Eviction: it records the requesters, prepares the
responder fields from the Pod's .spec.evictionResponders, and adds the default responders.requester, responder, or
requester-responder for a participant that has both roles. Requesters and responders can then find the Evictions
that concern them with a label selector.state of the responder with the highest priority to Active in .status.targetResponders
and sets startTime in its .status.responders entry. The state guides the responder through the eviction: each
responder observes its own state and acts only when the state tells it to.Active, it starts working on the eviction. In its .status.responders
entry, it periodically updates heartbeatTime, and optionally expectedCompletionTime and message. It keeps
observing its state while it works. If the state changes, for example to Canceled because every requester withdrew,
the responder stops. Otherwise, it ends its turn by setting completionTime.completionTime, it sets the state of the responder to
Completed. If the responder does not update heartbeatTime for 20 minutes, the controller sets its state to
Interrupted. In both cases, if the Pod is still running, the controller sets the responder with the next highest
priority to Active.The eviction ends when the Pod is evicted or when every requester withdraws. See Eviction outcomes for the conditions that report the result.
The controller sets these conditions on the Eviction and copies them to all its EvictionRequests. Requesters read the result and delete their EvictionRequests. The Eviction object is garbage collected after all of them are deleted.
Eviction in the lifecycle.k8s.io API group is a different kind from the policy/v1 Eviction that you POST to the
pods/<name>/eviction subresource for API-initiated eviction. See
Comparison with API-initiated eviction and PodDisruptionBudgets
for more details.This example evicts a database Pod that is managed by an operator. The operator acts as the responder and a node maintenance tool acts as the requester.
The responder is declared when the Pod is created, typically through the Pod template of the workload.
apiVersion: v1
kind: Pod
metadata:
name: db-0
spec:
evictionResponders:
- name: database.example.com/operator
# The operator is a high-level controller, so its priority is above 10000.
# Only low-level controllers, for example the ReplicaSet controller, should use 10000.
priority: 15000
containers:
- name: db
image: db:latest
The requester needs the name and the UID of the Pod. The UID makes sure that a new Pod with the same name is not evicted by mistake.
kubectl get pod db-0 -o jsonpath='{.metadata.uid}'
The requester then creates an EvictionRequest in the namespace of the Pod:
apiVersion: lifecycle.k8s.io/v1alpha1
kind: EvictionRequest
metadata:
name: drain-db-54qh7
spec:
requester: node-maintenance.example.com/drainer
intent: Eviction
target:
pod:
name: db-0
uid: 6a2e7f0c-3c55-4f43-9d0b-1f2a5c8e7b11
The evictionrequest-controller creates an Eviction for the Pod. The names of all requesters and responders are set as labels on the Eviction, so the requester can find it with a label selector:
kubectl get evictions -l node-maintenance.example.com/drainer=requester -o yaml
The Eviction is similar to:
apiVersion: lifecycle.k8s.io/v1alpha1
kind: Eviction
metadata:
name: pod-1-db-0
labels:
node-maintenance.example.com/drainer: requester
database.example.com/operator: responder
imperative-eviction.k8s.io/evictor: responder
ownerReferences:
- apiVersion: lifecycle.k8s.io/v1alpha1
kind: EvictionRequest
name: drain-db-54qh7
uid: 0b7c5d2e-91a4-4f6b-8c3d-5e2f7a9b1c04
spec:
target:
pod:
name: db-0
uid: 6a2e7f0c-3c55-4f43-9d0b-1f2a5c8e7b11
status:
observedGeneration: 1
conditions:
- type: Failed
status: "False"
reason: AwaitingEviction
- type: TargetEvicted
status: "False"
reason: AwaitingEviction
requesters:
- name: node-maintenance.example.com/drainer
intent: Eviction
targetResponders:
- name: database.example.com/operator
priority: 15000
state: Active
- name: imperative-eviction.k8s.io/evictor
priority: 100
state: Inactive
responders:
- name: database.example.com/operator
startTime: "2026-11-25T12:00:00Z"
- name: imperative-eviction.k8s.io/evictor
The operator is the active responder. The default responder imperative-eviction.k8s.io/evictor waits as a fallback.
The operator watches Evictions that carry its label (database.example.com/operator). When its entry in
.status.targetResponders becomes Active, it checks that .spec.target is a Pod it manages and starts working.
While it works, it should periodically update its own entry in .status.responders through the status subresource:
status:
responders:
- name: database.example.com/operator
heartbeatTime: "2026-11-25T12:07:00Z"
expectedCompletionTime: "2026-11-25T12:10:00Z"
message: "Replicating data to db-1 (60%)"
When the data is safe, the operator deletes or evicts the Pod and sets completionTime on its
entry:
status:
responders:
- name: database.example.com/operator
heartbeatTime: "2026-11-25T12:09:00Z"
completionTime: "2026-11-25T12:09:30Z"
message: "Data replicated to db-1, db-0 deleted"
When the Pod is deleted or reaches a terminal phase, the controller sets the state of the operator
to Completed and updates the conditions of the Eviction. It copies the conditions to every
EvictionRequest for that Pod. The requester can wait for the result:
kubectl wait --for=condition=TargetEvicted evictionrequest/drain-db-54qh7 --timeout=30m
The status of the EvictionRequest is then similar to:
status:
observedGeneration: 1
conditions:
- type: TargetEvicted
status: "True"
reason: PodDeleted
message: Target pod has been deleted.
- type: Failed
status: "False"
reason: Succeeded
The requester then deletes its EvictionRequest. Because the EvictionRequest is the only owner of the Eviction, the Eviction is garbage collected as well.
If the eviction is no longer needed before it completes, for example because the node maintenance was called off, the requester withdraws it:
kubectl patch evictionrequest drain-db-54qh7 --type=merge -p '{"spec":{"intent":"Withdrawn"}}'
The drainer is the only requester, so the controller cancels the Eviction. It sets the state of the operator to
Canceled and sets the Failed condition to True with the reason CanceledDueToNoRequesters. The operator stops
the replication and keeps db-0 running.
If a second requester had also created an EvictionRequest for db-0, both names would be listed in
.status.requesters. The withdrawal of the drainer would only change its intent in that list, and the operator would
continue until the second requester withdrew as well.
.spec.requester on all of them. The requester name should be a
domain-prefixed key such as acme.io/foo. The *.k8s.io and *.kubernetes.io domains are reserved.evictionrequest-controller manages the Eviction and ensures there is at most one active Eviction per Pod.
You should not create Evictions yourself..spec.intent current. Leave it at Eviction while you want the Pod evicted, and set it to Withdrawn as soon
as the eviction is no longer needed..spec.target.pod requires both name and uid. Evicting a Pod that is recreated with the same name would require a
new EvictionRequest..spec.requester.TargetEvicted or the Failed condition is True and you have processed the
result.A responder first registers itself on the Pods that it manages. It then watches the Evictions for these Pods, reads the
state that the evictionrequest-controller assigned to it, and decides what to do. While it works on an eviction, it
periodically updates the status of the Eviction to report its progress, until it completes its turn or the state tells
it to stop.
.spec.evictionResponders only on Pods that you manage or understand. The responder name should be a
domain-prefixed key such as acme.io/foo. The *.k8s.io and *.kubernetes.io domains are reserved.a.example.com/beta is picked before b.example.com/alpha.controller field in the Pod's .metadata.ownerReferences. This leaves room for other responders to run
before it or to act as a fallback after it. Priorities 0-999 are reserved for *.k8s.io responders.To find the Evictions that you have to respond to, use a label selector for the label whose key is your responder name.
Verify the target before you act on an Eviction. Check that the .spec.target.pod refers to a Pod that you manage.
Then find the entry with your name in .status.targetResponders and read its state. The controller assigns the state,
and it tells you what to do:
| State | Meaning | Expected reaction |
|---|---|---|
Inactive | The responder's turn has not come. | None. |
Active | The responder is running or expected to start soon. Its startTime is set. | Work on the eviction and report progress. |
Interrupted | The responder did not start or did not send a heartbeat in time. | Stop all the ongoing work. Another responder might be processing the eviction or recovering from the interruption. |
Canceled | No requester wants the eviction anymore. | Stop the eviction if possible, or help the application return to a healthy state as soon as possible. |
Completed | The responder set completionTime. | None. |
While your state is Active, update the entry with your name in .status.responders through the status subresource.
Use Server-Side Apply with your own field manager for these updates,
because the controller and the other responders write to the status of the same Eviction. Only the entry of the active
responder can be changed. Each update follows these steps:
.spec.target.pod refers to a Pod that you manage. Compare both the name and the UID, because an
Eviction can exist for a Pod that was recreated with the same name.state in .status.targetResponders. Continue only if it is Active. Otherwise, react as described in
the table above.heartbeatTime to the current time to signal that the eviction is not stuck. The value cannot move backwards.
If it is not updated for 20 minutes, the controller marks you as Interrupted and the next responder becomes
active. Send a heartbeat regularly, for example every few minutes, so that a short outage of your controller does
not exceed the deadline.expectedCompletionTime if you can make a reasonable estimate of when your part of the eviction ends.message to describe the progress in human-readable form.completionTime to the current time. This ends your turn, whether or not you terminated
the Pod.Optionally, emit an Event that refers to the Eviction to inform about the start or the progress of the eviction, or about the reason why it is blocked. Keep the number of events low.
message and give an estimate in expectedCompletionTime. Do not use heartbeats to block an eviction
indefinitely; if an eviction has to be blocked, use a PDB.completionTime immediately instead of letting the heartbeat deadline
expire.Every Eviction that targets a Pod includes the imperative-eviction.k8s.io/evictor responder with priority 100. It is
implemented by the imperative-eviction-responder-controller, which runs in the kube-controller-manager. It becomes
active after all other responders are done and calls API-initiated eviction for the Pod. If a PDB blocks the call, it
records the reason and the number of attempts in its message and retries with an exponential backoff, while it keeps
sending heartbeats. A Pod without custom responders is therefore evicted the same way as with API-initiated eviction,
with the retries handled for the requester.
An eviction ends when the evictionrequest-controller sets the TargetEvicted or the Failed condition to True. It
sets the condition on the Eviction and copies it to every EvictionRequest with the same target.
The eviction succeeds as soon as the Pod is no longer running. It is enough for the Pod to reach a terminal phase
(Succeeded or Failed) or to be deleted.
| Condition | Reason | Meaning |
|---|---|---|
TargetEvicted | PodTerminal | The Pod reached a terminal phase. The Pod object still exists. |
TargetEvicted | PodDeleted | The Pod was deleted. |
Failed | EvictionInvalid | The target is not valid, for example the Pod does not exist or its UID does not match. |
Failed | CanceledDueToNoRequesters | Every requester withdrew or deleted its request. |
Failed | NoFurtherResponder | All responders finished without evicting the Pod. |
The NoFurtherResponder outcome is a fallback and should not usually happen, because the default responder keeps
retrying until the Pod is gone.
A requester withdraws by setting .spec.intent to Withdrawn or by deleting its EvictionRequest. The eviction
continues while at least one requester keeps the Eviction intent. When none is left, the controller cancels the
eviction -- it sets the state of the active responder to Canceled and the Failed condition to True with the
reason CanceledDueToNoRequesters. Inactive responders never run, the active responder is expected to stop, and work
that responders have already done is not undone. Prefer Withdrawn over deletion so that responders have time to
react.
The outcome of an Eviction is final. The conditions of an EvictionRequest can be reset if the eviction was unsuccessful
and a new Eviction intent has been submitted.
Requesters should delete their EvictionRequests after they have processed the outcome. Every EvictionRequest is an
owner of its Eviction in .metadata.ownerReferences, so the Eviction is garbage collected after all of them are
deleted.
To see why an eviction is pending, look at the Eviction of the Pod:
.status.targetResponders shows which responder is active and which ones were interrupted, canceled, or completed..status.responders shows when the active responder started, its last heartbeat, its estimate, and its message..status.requesters shows who asked for the eviction.An eviction stays pending in these cases:
startTime, heartbeatTime, and
expectedCompletionTime, and check the responder itself.message contains the error from the Eviction API and the number of attempts.
Resolve this as described in Troubleshooting stuck
evictions.
To detect evictions that are blocked this way across the cluster, monitor the
imperative_eviction_responder_controller_failed_evictions_total metric of the kube-controller-manager. It counts
evictions for which the default responder made at least three unsuccessful calls to the pods/<name>/eviction
subresource. What counts as normal depends on your cluster and on the applications that run in it. A number of failed
evictions that is large for your cluster, or that rises sharply compared to its usual level, indicates that evictions
are not making progress, for example because applications are unavailable or their PDBs are too strict.API-initiated eviction is a single imperative call, and a PodDisruptionBudget (PDB) is the only way for an application owner to influence it. A PDB can only allow or deny the call based on how many Pods are healthy. An EvictionRequest, on the other hand, is declarative -- it records the intent to evict a Pod, lets responders act before the Pod is terminated, and reports the progress and the outcome in the status of the API objects.
The imperative approach leaves gaps:
An EvictionRequest closes these gaps. Responders run application-specific logic before the Pod is terminated, so a single-replica application can be moved without downtime. They can take as long as they need while they keep reporting progress. Progress is visible through heartbeats, an expected completion time, a message, and conditions, so a requester does not have to retry and can see how far the eviction is. All requesters for a Pod share one eviction, and each of them can withdraw its intent while it is in progress.
Eviction requests build on the existing mechanisms. The default imperative eviction responder uses API-initiated eviction, so PDBs still apply to Pods that no other responder terminates. API-initiated eviction and PDBs keep working as before for clients that do not use EvictionRequests.
The API is an integration point between components that remove Pods and components that manage applications. The following scenarios show how each side can use it. Whether a particular tool creates EvictionRequests or registers responders depends on that tool.
A node maintenance or drain tool cordons the node and creates one EvictionRequest for each Pod on it, instead of calling
the Eviction API in a retry loop. It then watches the TargetEvicted and Failed conditions to learn when the node is
empty, and reads the Evictions to show which responder is working on each Pod and when it expects to finish. If the
maintenance is called off, the tool sets the intent of its requests to Withdrawn and the applications stay where they
are. See Safely Drain a Node for the drain process that is based on
API-initiated eviction.
A component that performs any kind of descheduling and wants to move a Pod to a better node, or a cluster autoscaler that wants to remove an underused node, acts as a requester in the same way. Because all requesters share one Eviction for a Pod, these components do not interfere with a node drain that targets the same Pod. The eviction continues until every requester has withdrawn.
A controller that manages Pods can register as a responder and decide how its application leaves a node. For example: