rancher / local-path-provisioner

Dynamically provisioning persistent local storage with Kubernetes
Apache License 2.0
2.07k stars 439 forks source link

Should support anti afinity policy settings on pvc #381

Closed lidajia closed 1 month ago

lidajia commented 5 months ago

Scenario: The stateful set uses the storage class provided by the local path provider to define the pvctemplate. At the same time, the podTemplate uses the hostport. When there are multiple stateful sets using the same hostport or the same stateful set adjusts the number of replicas during the rolling upgrade process, after the pod is rescheduled, the following results may be generated: the podA has previously bound pv1 (on node node-1), and the new pod pod is also scheduled to node-1, And PV2 was allocated. After the creation of podA, due to its binding relationship with PV1, it needs to be scheduled to node-1. At this point, podB has already been scheduled to node-1, and there is a host port conflict between podA and podB, so podA will be in a pending state.

Appeal:

When storageclass dynamically creates PVs, it should be able to avoid creating anti affinity PVs on the same node based on the anti affinity policy set on the PVC.

This is not the same as the anti affinity strategy of pod, because due to the retention strategy of pv, pv exists, but pod may not necessarily exist

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.