GCE/AWS: Spread PetSet volume creation across zones

Long term we plan on integrating this into the scheduler, but in the
short term we use the volume name to place it onto a zone.

We hash the volume name so we don't bias to the first few zones.

If the volume name "looks like" a PetSet volume name (ending with
-<number>) then we use the number as an offset.  In that case we hash
the base name.

Fixes #27256
This commit is contained in:
Justin Santa Barbara
2016-06-16 13:36:55 -04:00
parent afedd3d34d
commit e711cbf912
7 changed files with 138 additions and 6 deletions

View File

@@ -49,6 +49,8 @@ type VolumeOptions struct {
// PV.Name of the appropriate PersistentVolume. Used to generate cloud
// volume name.
PVName string
// PVC.Name of the PersistentVolumeClaim, if we are auto-provisioning.
PVCName string
// Unique name of Kubernetes cluster.
ClusterName string
// Tags to attach to the real volume in the cloud provider - e.g. AWS EBS