mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 01:40:13 +00:00
PVCs using the ReadWriteOncePod access mode can only be referenced by a single pod. When a pod is scheduled that uses a ReadWriteOncePod PVC, return "Unschedulable" if the PVC is already in-use in the cluster. To support preemption, the "VolumeRestrictions" scheduler plugin computes cycle state during the PreFilter phase. This cycle state contains the number of references to the ReadWriteOncePod PVCs used by the pod-to-be-scheduled. During scheduler simulation (AddPod and RemovePod), we add and remove reference counts from the cycle state if they use any of these ReadWriteOncePod PVCs. In the Filter phase, the scheduler checks if there are any PVC reference conflicts, and returns "Unschedulable" if there is a conflict. This is a required feature for the ReadWriteOncePod beta. See for more context: https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode#beta |
||
---|---|---|
.. | ||
main_test.go | ||
preemption_test.go |