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

package prober

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

Index

Package Files

prober.go prober_manager.go worker.go

Variables

var ProberResults = metrics.NewCounterVec(
    &metrics.CounterOpts{
        Subsystem:      "prober",
        Name:           "probe_total",
        Help:           "Cumulative number of a liveness, readiness or startup probe for a container by result.",
        StabilityLevel: metrics.ALPHA,
    },
    []string{"probe_type",
        "result",
        "container",
        "pod",
        "namespace",
        "pod_uid"},
)

ProberResults stores the cumulative number of a probe by result as prometheus metrics.

type Manager Uses

type Manager interface {
    // AddPod creates new probe workers for every container probe. This should be called for every
    // pod created.
    AddPod(pod *v1.Pod)

    // RemovePod handles cleaning up the removed pod state, including terminating probe workers and
    // deleting cached results.
    RemovePod(pod *v1.Pod)

    // CleanupPods handles cleaning up pods which should no longer be running.
    // It takes a map of "desired pods" which should not be cleaned up.
    CleanupPods(desiredPods map[types.UID]sets.Empty)

    // UpdatePodStatus modifies the given PodStatus with the appropriate Ready state for each
    // container based on container running status, cached probe results and worker states.
    UpdatePodStatus(types.UID, *v1.PodStatus)

    // Start starts the Manager sync loops.
    Start()
}

Manager manages pod probing. It creates a probe "worker" for every container that specifies a probe (AddPod). The worker periodically probes its assigned container and caches the results. The manager use the cached probe results to set the appropriate Ready state in the PodStatus when requested (UpdatePodStatus). Updating probe parameters is not currently supported. TODO: Move liveness probing out of the runtime, to here.

func NewManager Uses

func NewManager(
    statusManager status.Manager,
    livenessManager results.Manager,
    startupManager results.Manager,
    runner kubecontainer.ContainerCommandRunner,
    refManager *kubecontainer.RefManager,
    recorder record.EventRecorder) Manager

NewManager creates a Manager for pod probing.

Directories

PathSynopsis
results
testing

Package prober imports 32 packages (graph) and is imported by 110 packages. Updated 2019-11-17. Refresh now. Tools for package owners.