status

package
v1.27.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 25 Imported by: 384

Documentation

Index

Constants

View Source
const (
	// UnknownContainerStatuses says that all container statuses are unknown.
	UnknownContainerStatuses = "UnknownContainerStatuses"
	// PodCompleted says that all related containers have succeeded.
	PodCompleted = "PodCompleted"
	// PodFailed says that the pod has failed and as such the containers have failed.
	PodFailed = "PodFailed"
	// ContainersNotReady says that one or more containers are not ready.
	ContainersNotReady = "ContainersNotReady"
	// ContainersNotInitialized says that one or more init containers have not succeeded.
	ContainersNotInitialized = "ContainersNotInitialized"
	// ReadinessGatesNotReady says that one or more pod readiness gates are not ready.
	ReadinessGatesNotReady = "ReadinessGatesNotReady"
)

Variables

This section is empty.

Functions

func GenerateContainersReadyCondition added in v1.11.0

func GenerateContainersReadyCondition(spec *v1.PodSpec, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition

GenerateContainersReadyCondition returns the status of "ContainersReady" condition. The status of "ContainersReady" condition is true when all containers are ready.

func GeneratePodHasNetworkCondition added in v1.25.0

func GeneratePodHasNetworkCondition(pod *v1.Pod, podStatus *kubecontainer.PodStatus) v1.PodCondition

func GeneratePodInitializedCondition added in v1.3.0

func GeneratePodInitializedCondition(spec *v1.PodSpec, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition

GeneratePodInitializedCondition returns initialized condition if all init containers in a pod are ready, else it returns an uninitialized condition.

func GeneratePodReadyCondition added in v1.2.0

func GeneratePodReadyCondition(spec *v1.PodSpec, conditions []v1.PodCondition, containerStatuses []v1.ContainerStatus, podPhase v1.PodPhase) v1.PodCondition

GeneratePodReadyCondition returns "Ready" condition of a pod. The status of "Ready" condition is "True", if all containers in a pod are ready AND all matching conditions specified in the ReadinessGates have status equal to "True".

func NeedToReconcilePodReadiness added in v1.11.0

func NeedToReconcilePodReadiness(pod *v1.Pod) bool

NeedToReconcilePodReadiness returns if the pod "Ready" condition need to be reconcile

Types

type Manager

type Manager interface {
	PodStatusProvider

	// Start the API server status sync loop.
	Start()

	// SetPodStatus caches updates the cached status for the given pod, and triggers a status update.
	SetPodStatus(pod *v1.Pod, status v1.PodStatus)

	// SetContainerReadiness updates the cached container status with the given readiness, and
	// triggers a status update.
	SetContainerReadiness(podUID types.UID, containerID kubecontainer.ContainerID, ready bool)

	// SetContainerStartup updates the cached container status with the given startup, and
	// triggers a status update.
	SetContainerStartup(podUID types.UID, containerID kubecontainer.ContainerID, started bool)

	// TerminatePod resets the container status for the provided pod to terminated and triggers
	// a status update.
	TerminatePod(pod *v1.Pod)

	// RemoveOrphanedStatuses scans the status cache and removes any entries for pods not included in
	// the provided podUIDs.
	RemoveOrphanedStatuses(podUIDs map[types.UID]bool)

	// State returns a read-only interface to the internal status manager state.
	State() state.Reader

	// SetPodAllocation checkpoints the resources allocated to a pod's containers.
	SetPodAllocation(pod *v1.Pod) error

	// SetPodResizeStatus checkpoints the last resizing decision for the pod.
	SetPodResizeStatus(podUID types.UID, resize v1.PodResizeStatus) error
}

Manager is the Source of truth for kubelet pod status, and should be kept up-to-date with the latest v1.PodStatus. It also syncs updates back to the API server.

func NewFakeManager added in v1.27.0

func NewFakeManager() Manager

NewFakeManager creates empty/fake memory manager

func NewManager

func NewManager(kubeClient clientset.Interface, podManager kubepod.Manager, podDeletionSafety PodDeletionSafetyProvider, podStartupLatencyHelper PodStartupLatencyStateHelper, stateFileDirectory string) Manager

NewManager returns a functional Manager.

type PodDeletionSafetyProvider added in v1.6.0

type PodDeletionSafetyProvider interface {
	// PodResourcesAreReclaimed returns true if the pod can safely be deleted.
	PodResourcesAreReclaimed(pod *v1.Pod, status v1.PodStatus) bool
	// PodCouldHaveRunningContainers returns true if the pod could have running containers.
	PodCouldHaveRunningContainers(pod *v1.Pod) bool
}

PodDeletionSafetyProvider provides guarantees that a pod can be safely deleted.

type PodStartupLatencyStateHelper added in v1.26.0

type PodStartupLatencyStateHelper interface {
	RecordStatusUpdated(pod *v1.Pod)
	DeletePodStartupState(podUID types.UID)
}

type PodStatusProvider added in v1.4.0

type PodStatusProvider interface {
	// GetPodStatus returns the cached status for the provided pod UID, as well as whether it
	// was a cache hit.
	GetPodStatus(uid types.UID) (v1.PodStatus, bool)
}

PodStatusProvider knows how to provide status for a pod. It's intended to be used by other components that need to introspect status.

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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