package volume
import "k8s.io/kubernetes/pkg/volume"
Package volume includes internal representations of external volume types as well as utility methods required to mount/unmount volumes to kubelets.
Index ¶
- Constants
- Variables
- func GetCurrentVolumes(rootDirectory string) map[string]Cleaner
- type Builder
- type Cleaner
- type DiskMounter
- func (mounter *DiskMounter) Mount(source string, target string, fstype string, flags uintptr, data string) error
- func (mounter *DiskMounter) RefCount(PD Interface) (string, int, error)
- func (mounter *DiskMounter) Unmount(target string, flags int) error
- type EmptyDir
- func (emptyDir *EmptyDir) GetPath() string
- func (emptyDir *EmptyDir) SetUp() error
- func (emptyDir *EmptyDir) TearDown() error
- type GCEDiskUtil
- func (util *GCEDiskUtil) AttachDisk(GCEPD *GCEPersistentDisk) error
- func (util *GCEDiskUtil) DetachDisk(GCEPD *GCEPersistentDisk, devicePath string) error
- type GCEPersistentDisk
- func (PD *GCEPersistentDisk) GetPath() string
- func (PD *GCEPersistentDisk) SetUp() error
- func (PD *GCEPersistentDisk) TearDown() error
- type HostDir
- type Interface
Constants ¶
const MOUNT_MS_BIND = 0
const MOUNT_MS_RDONLY = 0
Variables ¶
Functions ¶
func GetCurrentVolumes ¶
GetCurrentVolumes examines directory structure to determine volumes that are presently active and mounted. Returns a map of Cleaner types.
Types ¶
type Builder ¶
type Builder interface { // Uses Interface to provide the path for Docker binds. Interface // SetUp prepares and mounts/unpacks the volume to a directory path. SetUp() error }
Builder interface provides method to set up/mount the volume.
func CreateVolumeBuilder ¶
CreateVolumeBuilder returns a Builder capable of mounting a volume described by an *api.Volume, or an error.
type Cleaner ¶
type Cleaner interface { // TearDown unmounts the volume and removes traces of the SetUp procedure. TearDown() error }
Cleaner interface provides method to cleanup/unmount the volumes.
func CreateVolumeCleaner ¶
CreateVolumeCleaner returns a Cleaner capable of tearing down a volume.
type DiskMounter ¶
type DiskMounter struct{}
func (*DiskMounter) Mount ¶
func (mounter *DiskMounter) Mount(source string, target string, fstype string, flags uintptr, data string) error
func (*DiskMounter) RefCount ¶
func (mounter *DiskMounter) RefCount(PD Interface) (string, int, error)
func (*DiskMounter) Unmount ¶
func (mounter *DiskMounter) Unmount(target string, flags int) error
type EmptyDir ¶
EmptyDir volumes are temporary directories exposed to the pod. These do not persist beyond the lifetime of a pod.
func (*EmptyDir) GetPath ¶
func (*EmptyDir) SetUp ¶
SetUp creates new directory.
func (*EmptyDir) TearDown ¶
TearDown simply deletes everything in the directory.
type GCEDiskUtil ¶
type GCEDiskUtil struct{}
func (*GCEDiskUtil) AttachDisk ¶
func (util *GCEDiskUtil) AttachDisk(GCEPD *GCEPersistentDisk) error
Attaches a disk specified by a volume.GCEPersistentDisk to the current kubelet. Mounts the disk to it's global path.
func (*GCEDiskUtil) DetachDisk ¶
func (util *GCEDiskUtil) DetachDisk(GCEPD *GCEPersistentDisk, devicePath string) error
Unmounts the device and detaches the disk from the kubelet's host machine. Expects a GCE device path symlink. Ex: /dev/disk/by-id/google-mydisk-part1
type GCEPersistentDisk ¶
type GCEPersistentDisk struct { Name string PodID string RootDir string // Unique identifier of the PD, used to find the disk resource in the provider. PDName string // Filesystem type, optional. FSType string // Specifies the partition to mount Partition string // Specifies whether the disk will be attached as ReadOnly. ReadOnly bool // contains filtered or unexported fields }
GCEPersistentDisk volumes are disk resources provided by Google Compute Engine that are attached to the kubelet's host machine and exposed to the pod.
func (*GCEPersistentDisk) GetPath ¶
func (PD *GCEPersistentDisk) GetPath() string
func (*GCEPersistentDisk) SetUp ¶
func (PD *GCEPersistentDisk) SetUp() error
Attaches the disk and bind mounts to the volume path.
func (*GCEPersistentDisk) TearDown ¶
func (PD *GCEPersistentDisk) TearDown() error
Unmounts the bind mount, and detaches the disk only if the PD resource was the last reference to that disk on the kubelet.
type HostDir ¶
type HostDir struct { Path string }
HostDir volumes represent a bare host directory mount. The directory in Path will be directly exposed to the container.
func (*HostDir) GetPath ¶
func (*HostDir) SetUp ¶
SetUp implements interface definitions, even though host directory mounts don't require any setup or cleanup.
type Interface ¶
type Interface interface { // GetPath returns the directory path the volume is mounted to. GetPath() string }
Interface is a directory used by pods or hosts. All method implementations of methods in the volume interface must be idempotent.
Source Files ¶
doc.go gce_util.go mounter_unsupported.go volume.go
- Version
- v0.4.1
- Published
- Oct 17, 2014
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 1 minute ago –
Tools for package owners.