pod

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DaemonsetClusterAutoscalerPodAnnotationKey use to inform the cluster-autoscaler that a pod
	// should be considered as a DaemonSet pod
	DaemonsetClusterAutoscalerPodAnnotationKey = "cluster-autoscaler.kubernetes.io/daemonset-pod"
)

Variables

This section is empty.

Functions

func CreatePodFromDaemonSetReplicaSet

func CreatePodFromDaemonSetReplicaSet(scheme *runtime.Scheme, replicaset *datadoghqv1alpha1.ExtendedDaemonSetReplicaSet, node *corev1.Node, edsNode *datadoghqv1alpha1.ExtendedDaemonsetSetting, addNodeAffinity bool) (*corev1.Pod, error)

CreatePodFromDaemonSetReplicaSet use to create a Pod from a ReplicaSet instance and a specific Node name.

func GetContainerStatus

func GetContainerStatus(statuses []v1.ContainerStatus, name string) (v1.ContainerStatus, bool)

GetContainerStatus extracts the status of container "name" from "statuses". It also returns if "name" exists.

func GetExistingContainerStatus

func GetExistingContainerStatus(statuses []v1.ContainerStatus, name string) v1.ContainerStatus

GetExistingContainerStatus extracts the status of container "name" from "statuses",

func GetPodCondition

func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodConditionFromList

func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)

GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.

func GetPodReadyCondition

func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition

GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func HasPodSchedulerIssue

func HasPodSchedulerIssue(pod *v1.Pod) bool

HasPodSchedulerIssue returns true if a pod remained unscheduled for more than 10 minutes or if it stayed in `Terminating` state for longer than its grace period.

func IsEvicted

func IsEvicted(status *v1.PodStatus) bool

IsEvicted returns whether the status corresponds to an evicted pod

func IsPodAvailable

func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool

IsPodAvailable returns true if a pod is available; false otherwise. Precondition for an available pod is that it must be ready. On top of that, there are two cases when a pod can be considered available: 1. minReadySeconds == 0, or 2. LastTransitionTime (is set) + minReadySeconds < current time

func IsPodReady

func IsPodReady(pod *v1.Pod) bool

IsPodReady returns true if a pod is ready; false otherwise.

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status v1.PodStatus) bool

IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.

func IsPodRestarting

IsPodRestarting checks if a pod in the Canary deployment is restarting This returns the "reason" for the pod with the most restarts

func IsPodScheduled

func IsPodScheduled(pod *v1.Pod) (string, bool)

IsPodScheduled return true if it is already assigned to a Node

func SortPodByCreationTime

func SortPodByCreationTime(pods []*v1.Pod) []*v1.Pod

SortPodByCreationTime return the pods sorted by creation time from the newer to the older

func UpdatePodCondition

func UpdatePodCondition(status *v1.PodStatus, condition *v1.PodCondition) bool

UpdatePodCondition updates existing pod condition or creates a new one. Sets LastTransitionTime to now if the status has changed. Returns true if pod condition has changed or has been added.

Types

This section is empty.

Jump to

Keyboard shortcuts

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