mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Add GetAccessModes to volume plugin interface
This commit is contained in:
@@ -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"`
|
||||
|
@@ -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"`
|
||||
|
@@ -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
|
||||
|
@@ -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"`
|
||||
|
Reference in New Issue
Block a user