kubernetes: k8s.io/kubernetes/pkg/kubelet Index | Files | Directories

package kubelet

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

Package kubelet is the package that contains the libraries that drive the Kubelet binary. The kubelet is responsible for node level pod management. It runs on each worker in the cluster.


Package Files

active_deadline.go doc.go errors.go kubelet.go kubelet_dockershim.go kubelet_getters.go kubelet_network.go kubelet_network_linux.go kubelet_node_status.go kubelet_node_status_others.go kubelet_pods.go kubelet_resources.go kubelet_volumes.go pod_container_deletor.go pod_workers.go reason_cache.go runonce.go runtime.go time_cache.go volume_host.go


const (

    // ContainerLogsDir is the location of container logs.
    ContainerLogsDir = "/var/log/containers"

    // MaxContainerBackOff is the max backoff period, exported for the e2e test
    MaxContainerBackOff = 300 * time.Second

    // ContainerGCPeriod is the period for performing container garbage collection.
    ContainerGCPeriod = time.Minute
    // ImageGCPeriod is the period for performing image garbage collection.
    ImageGCPeriod = 5 * time.Minute
const (
    // KubeMarkMasqChain is the mark-for-masquerade chain
    // TODO: clean up this logic in kube-proxy
    KubeMarkMasqChain utiliptables.Chain = "KUBE-MARK-MASQ"

    // KubeMarkDropChain is the mark-for-drop chain
    KubeMarkDropChain utiliptables.Chain = "KUBE-MARK-DROP"

    // KubePostroutingChain is kubernetes postrouting rules
    KubePostroutingChain utiliptables.Chain = "KUBE-POSTROUTING"

    // KubeFirewallChain is kubernetes firewall rules
    KubeFirewallChain utiliptables.Chain = "KUBE-FIREWALL"
const (
    // NetworkNotReadyErrorMsg is used to describe the error that network is not ready
    NetworkNotReadyErrorMsg = "network is not ready"


var (
    // ErrNetworkUnknown indicates the network state is unknown
    ErrNetworkUnknown = errors.New("network state unknown")

func NewInitializedVolumePluginMgr Uses

func NewInitializedVolumePluginMgr(
    kubelet *Kubelet,
    secretManager secret.Manager,
    configMapManager configmap.Manager,
    tokenManager *token.Manager,
    plugins []volume.VolumePlugin,
    prober volume.DynamicPluginProber) (*volume.VolumePluginMgr, error)

NewInitializedVolumePluginMgr returns a new instance of volume.VolumePluginMgr initialized with kubelets implementation of the volume.VolumeHost interface.

kubelet - used by VolumeHost methods to expose kubelet specific parameters plugins - used to initialize volumePluginMgr

func PreInitRuntimeService Uses

func PreInitRuntimeService(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
    kubeDeps *Dependencies,
    crOptions *config.ContainerRuntimeOptions,
    containerRuntime string,
    runtimeCgroups string,
    remoteRuntimeEndpoint string,
    remoteImageEndpoint string,
    nonMasqueradeCIDR string) error

PreInitRuntimeService will init runtime service before RunKubelet.

type Bootstrap Uses

type Bootstrap interface {
    GetConfiguration() kubeletconfiginternal.KubeletConfiguration
    ListenAndServe(address net.IP, port uint, tlsOptions *server.TLSOptions, auth server.AuthInterface, enableCAdvisorJSONEndpoints, enableDebuggingHandlers, enableContentionProfiling, enableSystemLogHandler bool)
    ListenAndServeReadOnly(address net.IP, port uint, enableCAdvisorJSONEndpoints bool)
    Run(<-chan kubetypes.PodUpdate)
    RunOnce(<-chan kubetypes.PodUpdate) ([]RunPodResult, error)

Bootstrap is a bootstrapping interface for kubelet, targets the initialization protocol

type Dependencies Uses

type Dependencies struct {
    Options []Option

    // Injected Dependencies
    Auth                    server.AuthInterface
    CAdvisorInterface       cadvisor.Interface
    Cloud                   cloudprovider.Interface
    ContainerManager        cm.ContainerManager
    DockerOptions           *DockerOptions
    EventClient             v1core.EventsGetter
    HeartbeatClient         clientset.Interface
    OnHeartbeatFailure      func()
    KubeClient              clientset.Interface
    Mounter                 mount.Interface
    HostUtil                hostutil.HostUtils
    OOMAdjuster             *oom.OOMAdjuster
    OSInterface             kubecontainer.OSInterface
    PodConfig               *config.PodConfig
    Recorder                record.EventRecorder
    Subpather               subpath.Interface
    VolumePlugins           []volume.VolumePlugin
    DynamicPluginProber     volume.DynamicPluginProber
    TLSOptions              *server.TLSOptions
    KubeletConfigController *kubeletconfig.Controller
    RemoteRuntimeService    internalapi.RuntimeService
    RemoteImageService      internalapi.ImageManagerService
    // contains filtered or unexported fields

Dependencies is a bin for things we might consider "injected dependencies" -- objects constructed at runtime that are necessary for running the Kubelet. This is a temporary solution for grouping these objects while we figure out a more comprehensive dependency injection story for the Kubelet.

type DockerOptions Uses

type DockerOptions struct {
    DockerEndpoint            string
    RuntimeRequestTimeout     time.Duration
    ImagePullProgressDeadline time.Duration

DockerOptions contains docker specific configuration. Importantly, since it lives outside of `dockershim`, it should not depend on the `docker/docker` client library.

type KillPodOptions Uses

type KillPodOptions struct {
    // PodStatusFunc is the function to invoke to set pod status in response to a kill request.
    PodStatusFunc PodStatusFunc
    // PodTerminationGracePeriodSecondsOverride is optional override to use if a pod is being killed as part of kill operation.
    PodTerminationGracePeriodSecondsOverride *int64

KillPodOptions are options when performing a pod update whose update type is kill.

type Kubelet Uses

type Kubelet struct {

    // the list of handlers to call during pod sync loop.

    // the list of handlers to call during pod sync.

    // StatsProvider provides the node and the container stats.
    StatsProvider *stats.Provider
    // contains filtered or unexported fields

Kubelet is the main kubelet implementation.

func NewMainKubelet Uses

func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
    kubeDeps *Dependencies,
    crOptions *config.ContainerRuntimeOptions,
    containerRuntime string,
    hostname string,
    hostnameOverridden bool,
    nodeName types.NodeName,
    nodeIPs []net.IP,
    providerID string,
    cloudProvider string,
    certDirectory string,
    rootDirectory string,
    imageCredentialProviderConfigFile string,
    imageCredentialProviderBinDir string,
    registerNode bool,
    registerWithTaints []api.Taint,
    allowedUnsafeSysctls []string,
    experimentalMounterPath string,
    kernelMemcgNotification bool,
    experimentalCheckNodeCapabilitiesBeforeMount bool,
    experimentalNodeAllocatableIgnoreEvictionThreshold bool,
    minimumGCAge metav1.Duration,
    maxPerPodContainerCount int32,
    maxContainerCount int32,
    masterServiceNamespace string,
    registerSchedulable bool,
    keepTerminatedPodVolumes bool,
    nodeLabels map[string]string,
    seccompProfileRoot string,
    nodeStatusMaxImages int32) (*Kubelet, error)

NewMainKubelet instantiates a new Kubelet object along with all the required internal modules. No initialization of Kubelet and its modules should happen here.

func (*Kubelet) BirthCry Uses

func (kl *Kubelet) BirthCry()

BirthCry sends an event that the kubelet has started up.

func (*Kubelet) GeneratePodHostNameAndDomain Uses

func (kl *Kubelet) GeneratePodHostNameAndDomain(pod *v1.Pod) (string, string, error)

GeneratePodHostNameAndDomain creates a hostname and domain name for a pod, given that pod's spec and annotations or returns an error.

func (*Kubelet) GenerateRunContainerOptions Uses

func (kl *Kubelet) GenerateRunContainerOptions(pod *v1.Pod, container *v1.Container, podIP string, podIPs []string) (*kubecontainer.RunContainerOptions, func(), error)

GenerateRunContainerOptions generates the RunContainerOptions, which can be used by the container runtime to set parameters for launching a container.

func (*Kubelet) GetActivePods Uses

func (kl *Kubelet) GetActivePods() []*v1.Pod

GetActivePods returns non-terminal pods

func (*Kubelet) GetAttach Uses

func (kl *Kubelet) GetAttach(podFullName string, podUID types.UID, containerName string, streamOpts remotecommandserver.Options) (*url.URL, error)

GetAttach gets the URL the attach will be served from, or nil if the Kubelet will serve it.

func (*Kubelet) GetCachedMachineInfo Uses

func (kl *Kubelet) GetCachedMachineInfo() (*cadvisorapiv1.MachineInfo, error)

GetCachedMachineInfo assumes that the machine info can't change without a reboot

func (*Kubelet) GetCgroupCPUAndMemoryStats Uses

func (kl *Kubelet) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, error)

GetCgroupCPUAndMemoryStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) GetCgroupStats Uses

func (kl *Kubelet) GetCgroupStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, *statsapi.NetworkStats, error)

GetCgroupStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) GetConfiguration Uses

func (kl *Kubelet) GetConfiguration() kubeletconfiginternal.KubeletConfiguration

GetConfiguration returns the KubeletConfiguration used to configure the kubelet.

func (*Kubelet) GetContainerInfo Uses

func (kl *Kubelet) GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error)

GetContainerInfo is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) GetExec Uses

func (kl *Kubelet) GetExec(podFullName string, podUID types.UID, containerName string, cmd []string, streamOpts remotecommandserver.Options) (*url.URL, error)

GetExec gets the URL the exec will be served from, or nil if the Kubelet will serve it.

func (*Kubelet) GetExtraSupplementalGroupsForPod Uses

func (kl *Kubelet) GetExtraSupplementalGroupsForPod(pod *v1.Pod) []int64

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.

func (*Kubelet) GetHostIPs Uses

func (kl *Kubelet) GetHostIPs() ([]net.IP, error)

GetHostIPs returns host IPs or nil in case of error.

func (*Kubelet) GetHostname Uses

func (kl *Kubelet) GetHostname() string

GetHostname Returns the hostname as the kubelet sees it.

func (*Kubelet) GetKubeletContainerLogs Uses

func (kl *Kubelet) GetKubeletContainerLogs(ctx context.Context, podFullName, containerName string, logOptions *v1.PodLogOptions, stdout, stderr io.Writer) error

GetKubeletContainerLogs returns logs from the container TODO: this method is returning logs of random container attempts, when it should be returning the most recent attempt or all of them.

func (*Kubelet) GetNode Uses

func (kl *Kubelet) GetNode() (*v1.Node, error)

GetNode returns the node info for the configured node name of this Kubelet.

func (*Kubelet) GetNodeConfig Uses

func (kl *Kubelet) GetNodeConfig() cm.NodeConfig

GetNodeConfig returns the container manager node config.

func (*Kubelet) GetPodByCgroupfs Uses

func (kl *Kubelet) GetPodByCgroupfs(cgroupfs string) (*v1.Pod, bool)

GetPodByCgroupfs provides the pod that maps to the specified cgroup, as well as whether the pod was found.

func (*Kubelet) GetPodByFullName Uses

func (kl *Kubelet) GetPodByFullName(podFullName string) (*v1.Pod, bool)

GetPodByFullName gets the pod with the given 'full' name, which incorporates the namespace as well as whether the pod was found.

func (*Kubelet) GetPodByName Uses

func (kl *Kubelet) GetPodByName(namespace, name string) (*v1.Pod, bool)

GetPodByName provides the first pod that matches namespace and name, as well as whether the pod was found.

func (*Kubelet) GetPodCgroupParent Uses

func (kl *Kubelet) GetPodCgroupParent(pod *v1.Pod) string

GetPodCgroupParent gets pod cgroup parent from container manager.

func (*Kubelet) GetPodCgroupRoot Uses

func (kl *Kubelet) GetPodCgroupRoot() string

GetPodCgroupRoot returns the listeral cgroupfs value for the cgroup containing all pods

func (*Kubelet) GetPodDNS Uses

func (kl *Kubelet) GetPodDNS(pod *v1.Pod) (*runtimeapi.DNSConfig, error)

GetPodDNS returns DNS settings for the pod. This function is defined in kubecontainer.RuntimeHelper interface so we have to implement it.

func (*Kubelet) GetPodDir Uses

func (kl *Kubelet) GetPodDir(podUID types.UID) string

GetPodDir returns the full path to the per-pod data directory for the specified pod. This directory may not exist if the pod does not exist.

func (*Kubelet) GetPods Uses

func (kl *Kubelet) GetPods() []*v1.Pod

GetPods returns all pods bound to the kubelet and their spec, and the mirror pods.

func (*Kubelet) GetPortForward Uses

func (kl *Kubelet) GetPortForward(podName, podNamespace string, podUID types.UID, portForwardOpts portforward.V4Options) (*url.URL, error)

GetPortForward gets the URL the port-forward will be served from, or nil if the Kubelet will serve it.

func (*Kubelet) GetRawContainerInfo Uses

func (kl *Kubelet) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error)

GetRawContainerInfo is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) GetRequestedContainersInfo Uses

func (kl *Kubelet) GetRequestedContainersInfo(containerName string, options cadvisorv2.RequestOptions) (map[string]*cadvisorapiv1.ContainerInfo, error)

GetRequestedContainersInfo returns container info.

func (*Kubelet) GetRunningPods Uses

func (kl *Kubelet) GetRunningPods() ([]*v1.Pod, error)

GetRunningPods returns all pods running on kubelet from looking at the container runtime cache. This function converts kubecontainer.Pod to v1.Pod, so only the fields that exist in both kubecontainer.Pod and v1.Pod are considered meaningful.

func (*Kubelet) GetVersionInfo Uses

func (kl *Kubelet) GetVersionInfo() (*cadvisorapiv1.VersionInfo, error)

GetVersionInfo returns information about the version of cAdvisor in use.

func (*Kubelet) HandlePodAdditions Uses

func (kl *Kubelet) HandlePodAdditions(pods []*v1.Pod)

HandlePodAdditions is the callback in SyncHandler for pods being added from a config source.

func (*Kubelet) HandlePodCleanups Uses

func (kl *Kubelet) HandlePodCleanups() error

HandlePodCleanups performs a series of cleanup work, including terminating pod workers, killing unwanted pods, and removing orphaned volumes/pod directories. NOTE: This function is executed by the main sync loop, so it should not contain any blocking calls.

func (*Kubelet) HandlePodReconcile Uses

func (kl *Kubelet) HandlePodReconcile(pods []*v1.Pod)

HandlePodReconcile is the callback in the SyncHandler interface for pods that should be reconciled.

func (*Kubelet) HandlePodRemoves Uses

func (kl *Kubelet) HandlePodRemoves(pods []*v1.Pod)

HandlePodRemoves is the callback in the SyncHandler interface for pods being removed from a config source.

func (*Kubelet) HandlePodSyncs Uses

func (kl *Kubelet) HandlePodSyncs(pods []*v1.Pod)

HandlePodSyncs is the callback in the syncHandler interface for pods that should be dispatched to pod workers for sync.

func (*Kubelet) HandlePodUpdates Uses

func (kl *Kubelet) HandlePodUpdates(pods []*v1.Pod)

HandlePodUpdates is the callback in the SyncHandler interface for pods being updated from a config source.

func (*Kubelet) ImageFsStats Uses

func (kl *Kubelet) ImageFsStats() (*statsapi.FsStats, error)

ImageFsStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) IsPodDeleted Uses

func (kl *Kubelet) IsPodDeleted(uid types.UID) bool

IsPodDeleted returns true if the pod is deleted. For the pod to be deleted, either: 1. The pod object is deleted 2. The pod's status is evicted 3. The pod's deletion timestamp is set, and containers are not running

func (*Kubelet) IsPodTerminated Uses

func (kl *Kubelet) IsPodTerminated(uid types.UID) bool

IsPodTerminated returns true if the pod with the provided UID is in a terminal phase ("Failed", "Succeeded") or has been deleted and has no running containers. This corresponds to when a pod must accept changes to its pod spec (e.g. terminating containers allow grace period to be shortened)

func (*Kubelet) LatestLoopEntryTime Uses

func (kl *Kubelet) LatestLoopEntryTime() time.Time

LatestLoopEntryTime returns the last time in the sync loop monitor.

func (*Kubelet) ListPodCPUAndMemoryStats Uses

func (kl *Kubelet) ListPodCPUAndMemoryStats() ([]statsapi.PodStats, error)

ListPodCPUAndMemoryStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) ListPodStats Uses

func (kl *Kubelet) ListPodStats() ([]statsapi.PodStats, error)

ListPodStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) ListPodStatsAndUpdateCPUNanoCoreUsage Uses

func (kl *Kubelet) ListPodStatsAndUpdateCPUNanoCoreUsage() ([]statsapi.PodStats, error)

ListPodStatsAndUpdateCPUNanoCoreUsage is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) ListVolumesForPod Uses

func (kl *Kubelet) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool)

ListVolumesForPod returns a map of the mounted volumes for the given pod. The key in the map is the OuterVolumeSpecName (i.e. pod.Spec.Volumes[x].Name)

func (*Kubelet) ListenAndServe Uses

func (kl *Kubelet) ListenAndServe(address net.IP, port uint, tlsOptions *server.TLSOptions, auth server.AuthInterface, enableCAdvisorJSONEndpoints, enableDebuggingHandlers, enableContentionProfiling, enableSystemLogHandler bool)

ListenAndServe runs the kubelet HTTP server.

func (*Kubelet) ListenAndServePodResources Uses

func (kl *Kubelet) ListenAndServePodResources()

ListenAndServePodResources runs the kubelet podresources grpc service

func (*Kubelet) ListenAndServeReadOnly Uses

func (kl *Kubelet) ListenAndServeReadOnly(address net.IP, port uint, enableCAdvisorJSONEndpoints bool)

ListenAndServeReadOnly runs the kubelet HTTP server in read-only mode.

func (*Kubelet) PodResourcesAreReclaimed Uses

func (kl *Kubelet) PodResourcesAreReclaimed(pod *v1.Pod, status v1.PodStatus) bool

PodResourcesAreReclaimed returns true if all required node-level resources that a pod was consuming have been reclaimed by the kubelet. Reclaiming resources is a prerequisite to deleting a pod from the API server.

func (*Kubelet) ResyncInterval Uses

func (kl *Kubelet) ResyncInterval() time.Duration

ResyncInterval returns the interval used for periodic syncs.

func (*Kubelet) RlimitStats Uses

func (kl *Kubelet) RlimitStats() (*statsapi.RlimitStats, error)

RlimitStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) RootFsStats Uses

func (kl *Kubelet) RootFsStats() (*statsapi.FsStats, error)

RootFsStats is delegated to StatsProvider, which implements stats.Provider interface

func (*Kubelet) Run Uses

func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate)

Run starts the kubelet reacting to config updates

func (*Kubelet) RunInContainer Uses

func (kl *Kubelet) RunInContainer(podFullName string, podUID types.UID, containerName string, cmd []string) ([]byte, error)

RunInContainer runs a command in a container, returns the combined stdout, stderr as an array of bytes

func (*Kubelet) RunOnce Uses

func (kl *Kubelet) RunOnce(updates <-chan kubetypes.PodUpdate) ([]RunPodResult, error)

RunOnce polls from one configuration update and run the associated pods.

func (*Kubelet) ServeLogs Uses

func (kl *Kubelet) ServeLogs(w http.ResponseWriter, req *http.Request)

ServeLogs returns logs of current machine.

func (*Kubelet) StartGarbageCollection Uses

func (kl *Kubelet) StartGarbageCollection()

StartGarbageCollection starts garbage collection threads.

type OnCompleteFunc Uses

type OnCompleteFunc func(err error)

OnCompleteFunc is a function that is invoked when an operation completes. If err is non-nil, the operation did not complete successfully.

type Option Uses

type Option func(*Kubelet)

Option is a functional option type for Kubelet

type PodKiller Uses

type PodKiller interface {
    // KillPod receives pod speficier representing the pod to kill
    KillPod(pair *kubecontainer.PodPair)
    // PerformPodKillingWork performs the actual pod killing work via calling CRI
    // It returns after its Close() func is called and all outstanding pod killing requests are served
    // After Close() is called, this pod killer wouldn't accept any more pod killing requests
    // IsMirrorPodPendingTerminationByPodName checks whether the mirror pod for the given full pod name is pending termination
    IsMirrorPodPendingTerminationByPodName(podFullname string) bool
    // IsMirrorPodPendingTerminationByUID checks whether the mirror pod for the given uid is pending termination
    IsMirrorPodPendingTerminationByUID(uid types.UID) bool
    // MarkMirrorPodPendingTermination marks the mirror pod entering grace period of termination
    MarkMirrorPodPendingTermination(pod *v1.Pod)

PodKiller handles requests for killing pods

func NewPodKiller Uses

func NewPodKiller(kl *Kubelet) PodKiller

NewPodKiller returns a functional PodKiller

type PodStatusFunc Uses

type PodStatusFunc func(pod *v1.Pod, podStatus *kubecontainer.PodStatus) v1.PodStatus

PodStatusFunc is a function that is invoked to generate a pod status.

type PodWorkers Uses

type PodWorkers interface {
    UpdatePod(options *UpdatePodOptions)
    ForgetNonExistingPodWorkers(desiredPods map[types.UID]sets.Empty)
    ForgetWorker(uid types.UID)

PodWorkers is an abstract interface for testability.

type ReasonCache Uses

type ReasonCache struct {
    // contains filtered or unexported fields

ReasonCache stores the failure reason of the latest container start in a string, keyed by <pod_UID>_<container_name>. The goal is to propagate this reason to the container status. This endeavor is "best-effort" for two reasons:

1. The cache is not persisted.
2. We use an LRU cache to avoid extra garbage collection work. This
   means that some entries may be recycled before a pod has been

TODO(random-liu): Use more reliable cache which could collect garbage of failed pod. TODO(random-liu): Move reason cache to somewhere better.

func NewReasonCache Uses

func NewReasonCache() *ReasonCache

NewReasonCache creates an instance of 'ReasonCache'.

func (*ReasonCache) Get Uses

func (c *ReasonCache) Get(uid types.UID, name string) (*ReasonItem, bool)

Get gets error reason from the cache. The return values are error reason, error message and whether an error reason is found in the cache. If no error reason is found, empty string will be returned for error reason and error message.

func (*ReasonCache) Remove Uses

func (c *ReasonCache) Remove(uid types.UID, name string)

Remove removes error reason from the cache

func (*ReasonCache) Update Uses

func (c *ReasonCache) Update(uid types.UID, result kubecontainer.PodSyncResult)

Update updates the reason cache with the SyncPodResult. Only SyncResult with StartContainer action will change the cache.

type ReasonItem Uses

type ReasonItem struct {
    Err     error
    Message string

ReasonItem is the cached item in ReasonCache

type RunPodResult Uses

type RunPodResult struct {
    Pod *v1.Pod
    Err error

RunPodResult defines the running results of a Pod.

type SyncHandler Uses

type SyncHandler interface {
    HandlePodAdditions(pods []*v1.Pod)
    HandlePodUpdates(pods []*v1.Pod)
    HandlePodRemoves(pods []*v1.Pod)
    HandlePodReconcile(pods []*v1.Pod)
    HandlePodSyncs(pods []*v1.Pod)
    HandlePodCleanups() error

SyncHandler is an interface implemented by Kubelet, for testability

type UpdatePodOptions Uses

type UpdatePodOptions struct {
    // pod to update
    Pod *v1.Pod
    // the mirror pod for the pod to update, if it is a static pod
    MirrorPod *v1.Pod
    // the type of update (create, update, sync, kill)
    UpdateType kubetypes.SyncPodType
    // optional callback function when operation completes
    // this callback is not guaranteed to be completed since a pod worker may
    // drop update requests if it was fulfilling a previous request.  this is
    // only guaranteed to be invoked in response to a kill pod request which is
    // always delivered.
    OnCompleteFunc OnCompleteFunc
    // if update type is kill, use the specified options to kill the pod.
    KillPodOptions *KillPodOptions

UpdatePodOptions is an options struct to pass to a UpdatePod operation.


cadvisorPackage cadvisor provides an interface for Kubelet interactions with cAdvisor.
cm/cpumanager/topologyPackage topology contains helpers for the CPU manager.
configPackage config implements the pod configuration readers.
container/testingCode generated by mockery v1.0.0
cri/remotePackage remote contains gRPC implementation of internalapi.RuntimeService and internalapi.ImageManagerService.
cri/remote/fakePackage fake containers a fake gRPC implementation of internalapi.RuntimeService and internalapi.ImageManagerService.
cri/streaming/portforwardPackage portforward contains server-side logic for handling port forwarding requests.
cri/streaming/remotecommandPackage remotecommand contains functions related to executing commands in and attaching to pods.
custommetricsPackage custommetrics contains support for instrumenting cAdvisor to gather custom metrics from pods.
dockershimPackage dockershim implements a container runtime interface Docker integration using k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go
dockershim/libdocker/testingPackage testing is a generated GoMock package.
dockershim/network/cni/testingmock_cni is a mock of the `libcni.CNI` interface.
envvarsPackage envvars is the package that build the environment variables that kubernetes provides to the containers run by it.
evictionPackage eviction is responsible for enforcing eviction thresholds to maintain node stability.
imagesPackage images is responsible for managing lifecycle of container images.
kuberuntimePackage kuberuntime contains an implementation of kubecontainer.Runtime using the interface in pkg/kubelet/v1.
leakyPackage leaky holds bits of kubelet that should be internal but have leaked out through bad abstractions.
lifecyclePackage lifecycle contains handlers for pod lifecycle events and interfaces to integrate with kubelet admission, synchronization, and eviction of pods.
nodeshutdownPackage nodeshutdown can watch for node level shutdown events and trigger graceful termination of pods running on the node prior to a system shutdown.
nodeshutdown/systemdPackage systemd provides utility functions for kubelet to perform systemd related operations.
plegPackage pleg contains types and a generic implementation of the pod lifecycle event generator.
pluginmanager/cachePackage cache implements data structures used by the kubelet plugin manager to keep track of registered plugins.
pluginmanager/operationexecutorPackage operationexecutor implements interfaces that enable execution of register and unregister operations with a goroutinemap so that more than one operation is never triggered on the same plugin.
pluginmanager/reconcilerPackage reconciler implements interfaces that attempt to reconcile the desired state of the world with the actual state of the world by triggering relevant actions (register/deregister plugins).
pod/testingCode generated by mockery v1.0.0
qosPackage qos contains helper functions for quality of service.
serverPackage server contains functions related to serving Kubelet's external interface.
server/statsPackage stats handles exporting Kubelet and container stats.
tokenPackage token implements a manager of serviceaccount tokens for pods running on the node.
typesPackage types contains common types in the Kubelet.
utilPackage util holds utility functions.
util/storePackage store hosts a Store interface and its implementations.
volumemanager/cachePackage cache implements data structures used by the kubelet volume manager to keep track of attached volumes and the pods that mounted them.
volumemanager/populatorPackage populator implements interfaces that monitor and keep the states of the caches in sync with the "ground truth".
volumemanager/reconcilerPackage reconciler implements interfaces that attempt to reconcile the desired state of the world with the actual state of the world by triggering relevant actions (attach, detach, mount, unmount).
winstatsPackage winstats provides a client to get node and pod level stats on windows

Package kubelet imports 143 packages (graph) and is imported by 534 packages. Updated 2021-01-24. Refresh now. Tools for package owners.