Machine Eviction
Machine eviction lets an operator gracefully remove all Machines from a MachinePool. This feature can be used for example before a backing server goes into maintenance. Without it, the host is shut down while the Machine objects in the API still appear to be running, and there is no way to signal that the VMs on the pool should be shut down in an ordered fashion first.
Eviction is modeled after the Kubernetes taint eviction pattern: setting a NoExecute taint on a MachinePool triggers deletion of every bound Machine that does not tolerate the taint. The provider then handles graceful VM shutdown via its existing finalizer before the object is fully removed.
The mechanism is specified in IEP-21: Machine Eviction and involves two parties:
- The taint eviction controller in the IronCore control plane, which watches
MachinePooltaint changes and issuesDELETEon boundMachines that do not tolerate aNoExecutetaint. - The
machinepoollet, which observes the resultingdeletionTimestamp, drives the provider to shut the VM down, and then releases the object by removing its finalizer.
Taint Effects
Eviction is driven by the taint effect set on a MachinePool:
NoSchedule— prevents newMachines from being scheduled onto the pool. Existing machines are left untouched.NoExecute— additionally signals that machines already bound to the pool must be deleted unless they tolerate the taint.
A Machine tolerates a taint when its spec.tolerations contains an entry matching the taint's key, value, and effect. Tolerating machines are retained; all others are evicted.
The two effects compose into a drain pattern: first cordon the pool with NoSchedule so no new work lands on it, then evict the running machines with NoExecute.
Tainting a MachinePool for eviction looks like this:
apiVersion: compute.ironcore.dev/v1alpha1
kind: MachinePool
metadata:
name: my-machinepool
spec:
taints:
- key: maintenance
value: "true"
effect: NoExecuteEviction Flow
Every Machine carries a finalizer set by the machinepoollet:
metadata:
finalizers:
- machinepoollet.ironcore.dev/machineThis finalizer ensures the object is not removed from the API until the poollet has confirmed the VM is shut down. Deleting a Machine therefore blocks on graceful shutdown rather than dropping the object immediately.
When a NoExecute taint is added to a MachinePool, eviction proceeds as follows:
- The
NoExecutetaint is added to theMachinePool. - The taint eviction controller issues
DELETEon every boundMachinethat has no matching toleration. - The
Machinereceives adeletionTimestamp; the finalizer blocks its removal. - The
machinepoolletreconciles theMachine:- Calls the provider to shut down and delete the VM.
- Removes its finalizer.
- The API server removes the
Machineobject once the finalizer is gone.
Machines that tolerate the taint skip steps 2–5 and remain running on the pool.