Documentation ¶
Index ¶
- Constants
- Variables
- func CannotStart(pod *v1.Pod) (bool, datadoghqv1alpha1.ExtendedDaemonSetStatusReason)
- func CreatePodFromDaemonSetReplicaSet(scheme *runtime.Scheme, ...) (*corev1.Pod, error)
- func GetContainerStatus(statuses []v1.ContainerStatus, name string) (v1.ContainerStatus, bool)
- func GetExistingContainerStatus(statuses []v1.ContainerStatus, name string) v1.ContainerStatus
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func HasPodSchedulerIssue(pod *v1.Pod) bool
- func HighestRestartCount(pod *v1.Pod) (int, datadoghqv1alpha1.ExtendedDaemonSetStatusReason)
- func IsCannotStartReason(reason string) bool
- func IsEvicted(status *v1.PodStatus) bool
- func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func IsPodScheduled(pod *v1.Pod) (string, bool)
- func MostRecentRestart(pod *v1.Pod) (time.Time, datadoghqv1alpha1.ExtendedDaemonSetStatusReason)
- func PendingCreate(pod *v1.Pod) bool
- func SortPodByCreationTime(pods []*v1.Pod) []*v1.Pod
- func UpdatePodCondition(status *v1.PodStatus, condition *v1.PodCondition) bool
Constants ¶
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 ¶
var ( // StandardDaemonSetTolerations contains the tolerations that the EDS controller should add to // all pods it manages. // For consistency, this list must be in sync with the tolerations that are automatically added // by the regular kubernetes DaemonSet controller: // https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#taints-and-tolerations StandardDaemonSetTolerations = []corev1.Toleration{ { Key: "node.kubernetes.io/not-ready", Operator: corev1.TolerationOpExists, Effect: corev1.TaintEffectNoExecute, }, { Key: "node.kubernetes.io/unreachable", Operator: corev1.TolerationOpExists, Effect: corev1.TaintEffectNoExecute, }, { Key: "node.kubernetes.io/disk-pressure", Operator: corev1.TolerationOpExists, Effect: corev1.TaintEffectNoSchedule, }, { Key: "node.kubernetes.io/memory-pressure", Operator: corev1.TolerationOpExists, Effect: corev1.TaintEffectNoSchedule, }, { Key: "node.kubernetes.io/unschedulable", Operator: corev1.TolerationOpExists, Effect: corev1.TaintEffectNoSchedule, }, { Key: "node.kubernetes.io/network-unavailable", Operator: corev1.TolerationOpExists, Effect: corev1.TaintEffectNoSchedule, }, } )
Should be const but GO doesn't support const structures
Functions ¶
func CannotStart ¶ added in v0.5.0
func CannotStart(pod *v1.Pod) (bool, datadoghqv1alpha1.ExtendedDaemonSetStatusReason)
CannotStart returns true if the Pod is currently experiencing abnormal start condition
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 ¶
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 HighestRestartCount ¶ added in v0.5.0
func HighestRestartCount(pod *v1.Pod) (int, datadoghqv1alpha1.ExtendedDaemonSetStatusReason)
HighestRestartCount checks if a pod in the Canary deployment is restarting This returns the count and the "reason" for the pod with the most restarts
func IsCannotStartReason ¶ added in v0.5.0
IsCannotStartReason returns true for a reason that is considered an abnormal cannot start condition
func IsPodAvailable ¶
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 ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func IsPodScheduled ¶
IsPodScheduled return true if it is already assigned to a Node
func MostRecentRestart ¶ added in v0.5.0
func MostRecentRestart(pod *v1.Pod) (time.Time, datadoghqv1alpha1.ExtendedDaemonSetStatusReason)
MostRecentRestart returns the most recent restart time for a pod or the time
func PendingCreate ¶ added in v0.5.0
PendingCreate returns true if the Pod is pending create (may be an eventually resolving state)
func SortPodByCreationTime ¶
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.