Documentation ¶
Overview ¶
Package volume includes internal representations of external volume types as well as utility methods required to mount/unmount volumes to kubelets.
Index ¶
Constants ¶
const MOUNT_MS_BIND = syscall.MS_BIND
const MOUNT_MS_RDONLY = syscall.MS_RDONLY
Variables ¶
var ErrUnsupportedVolumeType = errors.New("unsupported volume type")
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.
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.
type DiskMounter ¶
type DiskMounter struct{}
func (*DiskMounter) Mount ¶
func (mounter *DiskMounter) Mount(source string, target string, fstype string, flags uintptr, data string) error
Wraps syscall.Mount()
func (*DiskMounter) RefCount ¶
func (mounter *DiskMounter) RefCount(mount Interface) (string, int, error)
Examines /proc/mounts to find the source device of the PD resource and the number of references to that device. Returns both the full device path under the /dev tree and the number of references.
type EmptyDir ¶
EmptyDir volumes are temporary directories exposed to the pod. These do not persist beyond the lifetime of a pod.
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 GitDir ¶ added in v0.5.1
type GitDir struct { Source string Revision string PodID string RootDir string Name string // contains filtered or unexported fields }