kubernetes: k8s.io/kubernetes/pkg/kubelet/volumemanager/populator Index | Files

package populator

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

Package populator implements interfaces that monitor and keep the states of the caches in sync with the "ground truth".


Package Files


type DesiredStateOfWorldPopulator Uses

type DesiredStateOfWorldPopulator interface {
    Run(sourcesReady config.SourcesReady, stopCh <-chan struct{})

    // ReprocessPod sets value for the specified pod in processedPods
    // to false, forcing it to be reprocessed. This is required to enable
    // remounting volumes on pod updates (volumes like Downward API volumes
    // depend on this behavior to ensure volume content is updated).
    ReprocessPod(podName volumetypes.UniquePodName)

    // HasAddedPods returns whether the populator has looped through the list
    // of active pods and added them to the desired state of the world cache,
    // at a time after sources are all ready, at least once. It does not
    // return true before sources are all ready because before then, there is
    // a chance many or all pods are missing from the list of active pods and
    // so few to none will have been added.
    HasAddedPods() bool

DesiredStateOfWorldPopulator periodically loops through the list of active pods and ensures that each one exists in the desired state of the world cache if it has volumes. It also verifies that the pods in the desired state of the world cache still exist, if not, it removes them.

func NewDesiredStateOfWorldPopulator Uses

func NewDesiredStateOfWorldPopulator(
    kubeClient clientset.Interface,
    loopSleepDuration time.Duration,
    getPodStatusRetryDuration time.Duration,
    podManager pod.Manager,
    podStatusProvider status.PodStatusProvider,
    desiredStateOfWorld cache.DesiredStateOfWorld,
    actualStateOfWorld cache.ActualStateOfWorld,
    kubeContainerRuntime kubecontainer.Runtime,
    keepTerminatedPodVolumes bool,
    csiMigratedPluginManager csimigration.PluginManager,
    intreeToCSITranslator csimigration.InTreeToCSITranslator,
    volumePluginMgr *volume.VolumePluginMgr) DesiredStateOfWorldPopulator

NewDesiredStateOfWorldPopulator returns a new instance of DesiredStateOfWorldPopulator.

kubeClient - used to fetch PV and PVC objects from the API server loopSleepDuration - the amount of time the populator loop sleeps between

successive executions

podManager - the kubelet podManager that is the source of truth for the pods

that exist on this host

desiredStateOfWorld - the cache to populate

Package populator imports 24 packages (graph) and is imported by 72 packages. Updated 2020-12-21. Refresh now. Tools for package owners.