kubernetes: github.com/igm/kubernetes/pkg/volume Index | Files

package volume

import "github.com/igm/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

Package Files

doc.go gce_util.go mounter_linux.go volume.go

Constants

const MOUNT_MS_BIND = syscall.MS_BIND
const MOUNT_MS_RDONLY = syscall.MS_RDONLY

Variables

var ErrUnsupportedVolumeType = errors.New("unsupported volume type")

func GetCurrentVolumes Uses

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.

type Builder Uses

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 Uses

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 Uses

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 Uses

func CreateVolumeCleaner(kind string, name string, podID string, rootDir string) (Cleaner, error)

CreateVolumeCleaner returns a Cleaner capable of tearing down a volume.

type DiskMounter Uses

type DiskMounter struct{}

func (*DiskMounter) Mount Uses

func (mounter *DiskMounter) Mount(source string, target string, fstype string, flags uintptr, data string) error

Wraps syscall.Mount()

func (*DiskMounter) RefCount Uses

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.

func (*DiskMounter) Unmount Uses

func (mounter *DiskMounter) Unmount(target string, flags int) error

Wraps syscall.Unmount()

type EmptyDir Uses

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.

func (*EmptyDir) GetPath Uses

func (emptyDir *EmptyDir) GetPath() string

func (*EmptyDir) SetUp Uses

func (emptyDir *EmptyDir) SetUp() error

SetUp creates new directory.

func (*EmptyDir) TearDown Uses

func (emptyDir *EmptyDir) TearDown() error

TearDown simply deletes everything in the directory.

type GCEDiskUtil Uses

type GCEDiskUtil struct{}

func (*GCEDiskUtil) AttachDisk Uses

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 Uses

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 Uses

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 Uses

func (PD *GCEPersistentDisk) GetPath() string

func (*GCEPersistentDisk) SetUp Uses

func (PD *GCEPersistentDisk) SetUp() error

Attaches the disk and bind mounts to the volume path.

func (*GCEPersistentDisk) TearDown Uses

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 Uses

type GitDir struct {
    Source   string
    Revision string
    PodID    string
    RootDir  string
    Name     string
    // contains filtered or unexported fields
}

func (*GitDir) ExecCommand Uses

func (g *GitDir) ExecCommand(command string, args []string, dir string) ([]byte, error)

func (*GitDir) GetPath Uses

func (g *GitDir) GetPath() string

func (*GitDir) SetUp Uses

func (g *GitDir) SetUp() error

func (*GitDir) TearDown Uses

func (g *GitDir) TearDown() error

TearDown simply deletes everything in the directory.

type HostDir Uses

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 Uses

func (hostVol *HostDir) GetPath() string

func (*HostDir) SetUp Uses

func (hostVol *HostDir) SetUp() error

SetUp implements interface definitions, even though host directory mounts don't require any setup or cleanup.

type Interface Uses

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.

Package volume imports 18 packages (graph). Updated 2018-04-17. Refresh now. Tools for package owners.