lifecycle

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlerRunner

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

Types

type FakeHandlerRunner added in v1.3.0

type FakeHandlerRunner struct {
	sync.Mutex
	HandlerRuns []string
	Err         error
}

func NewFakeHandlerRunner added in v1.3.0

func NewFakeHandlerRunner() *FakeHandlerRunner

func (*FakeHandlerRunner) Reset added in v1.3.0

func (hr *FakeHandlerRunner) Reset()

func (*FakeHandlerRunner) Run added in v1.3.0

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

type HandlerRunner

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

func (*HandlerRunner) Run

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

type PodAdmitAttributes added in v1.3.0

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

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

type PodAdmitHandler added in v1.3.0

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

PodAdmitHandler is notified during pod admission.

type PodAdmitHandlers added in v1.3.0

type PodAdmitHandlers []PodAdmitHandler

PodAdmitHandlers maintains a list of handlers to pod admission.

func (*PodAdmitHandlers) AddPodAdmitHandler added in v1.3.0

func (handlers *PodAdmitHandlers) AddPodAdmitHandler(a PodAdmitHandler)

AddPodAdmitHandler adds the specified observer.

type PodAdmitResult added in v1.3.0

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 added in v1.3.0

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

PodAdmitTarget maintains a list of handlers to invoke.

type PodLifecycleTarget added in v1.3.0

type PodLifecycleTarget interface {
	PodAdmitTarget
	PodSyncLoopTarget
	PodSyncTarget
}

PodLifecycleTarget groups a set of lifecycle interfaces for convenience.

type PodSyncHandler added in v1.3.0

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 *api.Pod) ShouldEvictResponse
}

PodSyncHandler is invoked during each sync pod operation.

type PodSyncHandlers added in v1.3.0

type PodSyncHandlers []PodSyncHandler

PodSyncHandlers maintains a list of handlers to pod sync.

func (*PodSyncHandlers) AddPodSyncHandler added in v1.3.0

func (handlers *PodSyncHandlers) AddPodSyncHandler(a PodSyncHandler)

AddPodSyncHandler adds the specified handler.

type PodSyncLoopHandler added in v1.3.0

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 *api.Pod) bool
}

PodSyncLoopHandler is invoked during each sync loop iteration.

type PodSyncLoopHandlers added in v1.3.0

type PodSyncLoopHandlers []PodSyncLoopHandler

PodSyncLoopHandlers maintains a list of handlers to pod sync loop.

func (*PodSyncLoopHandlers) AddPodSyncLoopHandler added in v1.3.0

func (handlers *PodSyncLoopHandlers) AddPodSyncLoopHandler(a PodSyncLoopHandler)

AddPodSyncLoopHandler adds the specified observer.

type PodSyncLoopTarget added in v1.3.0

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

PodSyncLoopTarget maintains a list of handlers to pod sync loop.

type PodSyncTarget added in v1.3.0

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

PodSyncTarget maintains a list of handlers to pod sync.

type ShouldEvictResponse added in v1.3.0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL