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 ¶
func GetCurrentVolumes(rootDirectory string) map[string]Cleaner
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 ¶
func CreateVolumeBuilder(volume *api.Volume, podID string, rootDir string) (Builder, error)
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 ¶
func CreateVolumeCleaner(kind string, name string, podID string, rootDir string) (Cleaner, error)
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
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 ¶
type EmptyDir struct {
Name string
PodID string
RootDir string
}
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.
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
}
func (*GitDir) ExecCommand ¶ added in v0.5.1
func (g *GitDir) ExecCommand(command string, args []string, dir string) ([]byte, error)