Add PV.Name into names of generated GCE/AWS/OSP volumes.

Volume names have now format <cluster-name>-dynamic-<pv-name>.

pv-name is guaranteed to be unique in Kubernetes cluster, adding
<cluster-name> ensures we don't conflict with any running cluster
in the cloud project (kube-controller-manager --cluster-name=XXX).

'kubernetes' is the default cluster name.
This commit is contained in:
Jan Safranek
2016-02-12 09:46:59 +01:00
parent b5c12d10b8
commit 1d0b1c227b
12 changed files with 86 additions and 18 deletions

View File

@@ -49,6 +49,10 @@ type VolumeOptions struct {
AccessModes []api.PersistentVolumeAccessMode
// Reclamation policy for a persistent volume
PersistentVolumeReclaimPolicy api.PersistentVolumeReclaimPolicy
// PV.Name of the appropriate PersistentVolume. Used to generate cloud volume name.
PVName string
// Unique name of Kubernetes cluster.
ClusterName string
// Tags to attach to the real volume in the cloud provider - e.g. AWS EBS
CloudTags *map[string]string
}