Add GetAccessModes to volume plugin interface

This commit is contained in:
markturansky
2015-03-12 15:37:02 -04:00
parent ed68c8e82b
commit 111f3d5120
12 changed files with 216 additions and 1 deletions

View File

@@ -195,6 +195,32 @@ type VolumeSource struct {
NFS *NFSVolumeSource `json:"nfs"`
}
// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs.
// Exactly one of its members must be set.
type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way
HostPath *HostPathVolumeSource `json:"hostPath"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
NFS *NFSVolumeSource `json:"nfs"`
}
// used by VolumeSources to describe their mounting/access modes
type AccessModeType string
const (
// can be mounted read/write mode to exactly 1 host
ReadWriteOnce AccessModeType = "ReadWriteOnce"
// can be mounted in read-only mode to many hosts
ReadOnlyMany AccessModeType = "ReadOnlyMany"
// can be mounted in read/write mode to many hosts
ReadWriteMany AccessModeType = "ReadWriteMany"
)
// HostPathVolumeSource represents a host directory mapped into a pod.
type HostPathVolumeSource struct {
Path string `json:"path"`

View File

@@ -109,6 +109,32 @@ type VolumeSource struct {
NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine "`
}
// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs.
// Exactly one of its members must be set.
type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way
HostPath *HostPathVolumeSource `json:"hostPath" description:"Persistent hostPath volume useful for development and testing"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
NFS *NFSVolumeSource `json:"nfs" description:"Persistent NFS volume that will be mounted in the host machine"`
}
// used by VolumeSources to describe their mounting/access modes
type AccessModeType string
const (
// can be mounted read/write mode to exactly 1 host
ReadWriteOnce AccessModeType = "ReadWriteOnce"
// can be mounted in read-only mode to many hosts
ReadOnlyMany AccessModeType = "ReadOnlyMany"
// can be mounted in read/write mode to many hosts
ReadWriteMany AccessModeType = "ReadWriteMany"
)
// HostPathVolumeSource represents bare host directory volume.
type HostPathVolumeSource struct {
Path string `json:"path" description:"path of the directory on the host"`

View File

@@ -82,6 +82,32 @@ type VolumeSource struct {
NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine"`
}
// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs.
// Exactly one of its members must be set.
type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way
HostPath *HostPathVolumeSource `json:"hostPath" description:"Persistent hostPath volume useful for development and testing"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
NFS *NFSVolumeSource `json:"nfs" description:"Persistent NFS volume that will be mounted in the host machine"`
}
// used by VolumeSources to describe their mounting/access modes
type AccessModeType string
const (
// can be mounted read/write mode to exactly 1 host
ReadWriteOnce AccessModeType = "ReadWriteOnce"
// can be mounted in read-only mode to many hosts
ReadOnlyMany AccessModeType = "ReadOnlyMany"
// can be mounted in read/write mode to many hosts
ReadWriteMany AccessModeType = "ReadWriteMany"
)
// HostPathVolumeSource represents bare host directory volume.
//
// https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/volumes.md#hostdir

View File

@@ -214,6 +214,32 @@ type VolumeSource struct {
NFS *NFSVolumeSource `json:"nfs" description:"NFS volume that will be mounted in the host machine"`
}
// PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs.
// Exactly one of its members must be set.
type PersistentVolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk" description:"GCE disk resource attached to the host machine on demand"`
// HostPath represents a directory on the host.
// This is useful for development and testing only.
// on-host storage is not supported in any way
HostPath *HostPathVolumeSource `json:"hostPath" description:"Persistent hostPath volume useful for development and testing"`
// NFS represents an NFS mount on the host that shares a pod's lifetime
NFS *NFSVolumeSource `json:"nfs" description:"Persistent NFS volume that will be mounted in the host machine"`
}
// used by VolumeSources to describe their mounting/access modes
type AccessModeType string
const (
// can be mounted read/write mode to exactly 1 host
ReadWriteOnce AccessModeType = "ReadWriteOnce"
// can be mounted in read-only mode to many hosts
ReadOnlyMany AccessModeType = "ReadOnlyMany"
// can be mounted in read/write mode to many hosts
ReadWriteMany AccessModeType = "ReadWriteMany"
)
// HostPathVolumeSource represents bare host directory volume.
type HostPathVolumeSource struct {
Path string `json:"path" description:"path of the directory on the host"`