Allow multiple mounts in StatefulSet volume zone placement
We have some heuristics that ensure that volumes (and hence stateful set pods) are spread out across zones. Sadly they forgot to account for multiple mounts. This PR updates the heuristic to ignore the mount name when we see something that looks like a statefulset volume, thus ensuring that multiple mounts end up in the same AZ. Fix #35695
This commit is contained in:
@@ -91,6 +91,7 @@ func getPodName(set *apps.StatefulSet, ordinal int) string {
|
||||
// getPersistentVolumeClaimName getsthe name of PersistentVolumeClaim for a Pod with an ordinal index of ordinal. claim
|
||||
// must be a PersistentVolumeClaim from set's VolumeClaims template.
|
||||
func getPersistentVolumeClaimName(set *apps.StatefulSet, claim *v1.PersistentVolumeClaim, ordinal int) string {
|
||||
// NOTE: This name format is used by the heuristics for zone spreading in ChooseZoneForVolume
|
||||
return fmt.Sprintf("%s-%s-%d", claim.Name, set.Name, ordinal)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user