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

package lifecycle

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

Handlers for pod lifecycle events and interfaces to integrate with kubelet admission, synchronization, and eviction of pods.

Index

Package Files

admission_failure_handler_stub.go doc.go handlers.go interfaces.go predicate.go

func NewHandlerRunner Uses

func NewHandlerRunner(httpGetter kubetypes.HttpGetter, commandRunner kubecontainer.ContainerCommandRunner, containerManager podStatusProvider) kubecontainer.HandlerRunner

func NewPredicateAdmitHandler Uses

func NewPredicateAdmitHandler(getNodeAnyWayFunc getNodeAnyWayFuncType, admissionFailureHandler AdmissionFailureHandler, pluginResourceUpdateFunc pluginResourceUpdateFuncType) *predicateAdmitHandler

type AdmissionFailureHandler Uses

type AdmissionFailureHandler interface {
    HandleAdmissionFailure(admitPod *v1.Pod, failureReasons []predicates.PredicateFailureReason) (bool, []predicates.PredicateFailureReason, error)
}

AdmissionFailureHandler is an interface which defines how to deal with a failure to admit a pod. This allows for the graceful handling of pod admission failure.

type AdmissionFailureHandlerStub Uses

type AdmissionFailureHandlerStub struct{}

AdmissionFailureHandlerStub is an AdmissionFailureHandler that does not perform any handling of admission failure. It simply passes the failure on.

func NewAdmissionFailureHandlerStub Uses

func NewAdmissionFailureHandlerStub() *AdmissionFailureHandlerStub

func (*AdmissionFailureHandlerStub) HandleAdmissionFailure Uses

func (n *AdmissionFailureHandlerStub) HandleAdmissionFailure(admitPod *v1.Pod, failureReasons []predicates.PredicateFailureReason) (bool, []predicates.PredicateFailureReason, error)

type HandlerRunner Uses

type HandlerRunner struct {
    // contains filtered or unexported fields
}

func (*HandlerRunner) Run Uses

func (hr *HandlerRunner) Run(containerID kubecontainer.ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.Handler) (string, error)

type PodAdmitAttributes Uses

type PodAdmitAttributes struct {
    // the pod to evaluate for admission
    Pod *v1.Pod
    // all pods bound to the kubelet excluding the pod being evaluated
    OtherPods []*v1.Pod
}

PodAdmitAttributes is the context for a pod admission decision. The member fields of this struct should never be mutated.

type PodAdmitHandler Uses

type PodAdmitHandler interface {
    // Admit evaluates if a pod can be admitted.
    Admit(attrs *PodAdmitAttributes) PodAdmitResult
}

PodAdmitHandler is notified during pod admission.

func NewAppArmorAdmitHandler Uses

func NewAppArmorAdmitHandler(validator apparmor.Validator) PodAdmitHandler

func NewNoNewPrivsAdmitHandler Uses

func NewNoNewPrivsAdmitHandler(runtime kubecontainer.Runtime) PodAdmitHandler

func NewProcMountAdmitHandler Uses

func NewProcMountAdmitHandler(runtime kubecontainer.Runtime) PodAdmitHandler

type PodAdmitHandlers Uses

type PodAdmitHandlers []PodAdmitHandler

PodAdmitHandlers maintains a list of handlers to pod admission.

func (*PodAdmitHandlers) AddPodAdmitHandler Uses

func (handlers *PodAdmitHandlers) AddPodAdmitHandler(a PodAdmitHandler)

AddPodAdmitHandler adds the specified observer.

type PodAdmitResult Uses

type PodAdmitResult struct {
    // if true, the pod should be admitted.
    Admit bool
    // a brief single-word reason why the pod could not be admitted.
    Reason string
    // a brief message explaining why the pod could not be admitted.
    Message string
}

PodAdmitResult provides the result of a pod admission decision.

type PodAdmitTarget Uses

type PodAdmitTarget interface {
    // AddPodAdmitHandler adds the specified handler.
    AddPodAdmitHandler(a PodAdmitHandler)
}

PodAdmitTarget maintains a list of handlers to invoke.

type PodLifecycleTarget Uses

type PodLifecycleTarget interface {
    PodAdmitTarget
    PodSyncLoopTarget
    PodSyncTarget
}

PodLifecycleTarget groups a set of lifecycle interfaces for convenience.

type PodSyncHandler Uses

type PodSyncHandler interface {
    // ShouldEvict is invoked during each sync pod operation to determine
    // if the pod should be evicted from the kubelet.  If so, the pod status
    // is updated to mark its phase as failed with the provided reason and message,
    // and the pod is immediately killed.
    // This operation must return immediately as its called for each sync pod.
    // The provided pod should never be modified.
    ShouldEvict(pod *v1.Pod) ShouldEvictResponse
}

PodSyncHandler is invoked during each sync pod operation.

type PodSyncHandlers Uses

type PodSyncHandlers []PodSyncHandler

PodSyncHandlers maintains a list of handlers to pod sync.

func (*PodSyncHandlers) AddPodSyncHandler Uses

func (handlers *PodSyncHandlers) AddPodSyncHandler(a PodSyncHandler)

AddPodSyncHandler adds the specified handler.

type PodSyncLoopHandler Uses

type PodSyncLoopHandler interface {
    // ShouldSync returns true if the pod needs to be synced.
    // This operation must return immediately as its called for each pod.
    // The provided pod should never be modified.
    ShouldSync(pod *v1.Pod) bool
}

PodSyncLoopHandler is invoked during each sync loop iteration.

type PodSyncLoopHandlers Uses

type PodSyncLoopHandlers []PodSyncLoopHandler

PodSyncLoopHandlers maintains a list of handlers to pod sync loop.

func (*PodSyncLoopHandlers) AddPodSyncLoopHandler Uses

func (handlers *PodSyncLoopHandlers) AddPodSyncLoopHandler(a PodSyncLoopHandler)

AddPodSyncLoopHandler adds the specified observer.

type PodSyncLoopTarget Uses

type PodSyncLoopTarget interface {
    // AddPodSyncLoopHandler adds the specified handler.
    AddPodSyncLoopHandler(a PodSyncLoopHandler)
}

PodSyncLoopTarget maintains a list of handlers to pod sync loop.

type PodSyncTarget Uses

type PodSyncTarget interface {
    // AddPodSyncHandler adds the specified handler
    AddPodSyncHandler(a PodSyncHandler)
}

PodSyncTarget maintains a list of handlers to pod sync.

type ShouldEvictResponse Uses

type ShouldEvictResponse struct {
    // if true, the pod should be evicted.
    Evict bool
    // a brief CamelCase reason why the pod should be evicted.
    Reason string
    // a brief message why the pod should be evicted.
    Message string
}

ShouldEvictResponse provides the result of a should evict request.

Package lifecycle imports 16 packages (graph) and is imported by 286 packages. Updated 2019-01-17. Refresh now. Tools for package owners.