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
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