kubernetesk8s.io/kubernetes/pkg/kubelet/volumemanager Index | Files | Directories

package volumemanager

import "k8s.io/kubernetes/pkg/kubelet/volumemanager"

Index

Types

type VolumeManager

type VolumeManager interface {
	// Starts the volume manager and all the asynchronous loops that it controls
	Run(sourcesReady config.SourcesReady, stopCh <-chan struct{})

	// WaitForAttachAndMount processes the volumes referenced in the specified
	// pod and blocks until they are all attached and mounted (reflected in
	// actual state of the world).
	// An error is returned if all volumes are not attached and mounted within
	// the duration defined in podAttachAndMountTimeout.
	WaitForAttachAndMount(pod *api.Pod) error

	// GetMountedVolumesForPod returns a VolumeMap containing the volumes
	// referenced by the specified pod that are successfully attached and
	// mounted. The key in the map is the OuterVolumeSpecName (i.e.
	// pod.Spec.Volumes[x].Name). It returns an empty VolumeMap if pod has no
	// volumes.
	GetMountedVolumesForPod(podName types.UniquePodName) container.VolumeMap

	// GetExtraSupplementalGroupsForPod returns a list of the extra
	// supplemental groups for the Pod. These extra supplemental groups come
	// from annotations on persistent volumes that the pod depends on.
	GetExtraSupplementalGroupsForPod(pod *api.Pod) []int64

	// Returns a list of all volumes that implement the volume.Attacher
	// interface and are currently in use according to the actual and desired
	// state of the world caches. A volume is considered "in use" as soon as it
	// is added to the desired state of world, indicating it *should* be
	// attached to this node and remains "in use" until it is removed from both
	// the desired state of the world and the actual state of the world, or it
	// has been unmounted (as indicated in actual state of world).
	// TODO(#27653): VolumesInUse should be handled gracefully on kubelet'
	// restarts.
	GetVolumesInUse() []api.UniqueVolumeName

	// VolumeIsAttached returns true if the given volume is attached to this
	// node.
	VolumeIsAttached(volumeName api.UniqueVolumeName) bool

	// Marks the specified volume as having successfully been reported as "in
	// use" in the nodes's volume status.
	MarkVolumesAsReportedInUse(volumesReportedAsInUse []api.UniqueVolumeName)
}

VolumeManager runs a set of asynchronous loops that figure out which volumes need to be attached/mounted/unmounted/detached based on the pods scheduled on this node and makes it so.

func NewVolumeManager

func NewVolumeManager(
	controllerAttachDetachEnabled bool,
	hostName string,
	podManager pod.Manager,
	kubeClient internalclientset.Interface,
	volumePluginMgr *volume.VolumePluginMgr,
	kubeContainerRuntime kubecontainer.Runtime,
	mounter mount.Interface,
	kubeletPodsDir string,
	recorder record.EventRecorder) (VolumeManager, error)

NewVolumeManager returns a new concrete instance implementing the VolumeManager interface.

kubeClient - kubeClient is the kube API client used by DesiredStateOfWorldPopulator

to communicate with the API server to fetch PV and PVC objects

volumePluginMgr - the volume plugin manager used to access volume plugins.

Must be pre-initialized.

Source Files

volume_manager.go

Directories

PathSynopsis
pkg/kubelet/volumemanager/cachePackage cache implements data structures used by the kubelet volume manager to keep track of attached volumes and the pods that mounted them.
pkg/kubelet/volumemanager/populatorPackage populator implements interfaces that monitor and keep the states of the caches in sync with the "ground truth".
pkg/kubelet/volumemanager/reconcilerPackage reconciler implements interfaces that attempt to reconcile the desired state of the with the actual state of the world by triggering relevant actions (attach, detach, mount, unmount).
Version
v1.4.0-beta.5
Published
Sep 15, 2016
Platform
linux/amd64
Imports
22 packages
Last checked
19 minutes ago

Tools for package owners.