Documentation ¶
Index ¶
- func FailedToSchedule(pod *corev1.Pod) bool
- func HasDoNotDisrupt(pod *corev1.Pod) bool
- func HasPodAntiAffinity(pod *corev1.Pod) bool
- func HasRequiredPodAntiAffinity(pod *corev1.Pod) bool
- func IsActive(pod *corev1.Pod) bool
- func IsDisruptable(pod *corev1.Pod) bool
- func IsDrainable(pod *corev1.Pod, clk clock.Clock) bool
- func IsEvictable(pod *corev1.Pod) bool
- func IsOwnedBy(pod *corev1.Pod, gvks []schema.GroupVersionKind) bool
- func IsOwnedByDaemonSet(pod *corev1.Pod) bool
- func IsOwnedByNode(pod *corev1.Pod) bool
- func IsOwnedByStatefulSet(pod *corev1.Pod) bool
- func IsPreempting(pod *corev1.Pod) bool
- func IsProvisionable(pod *corev1.Pod) bool
- func IsReschedulable(pod *corev1.Pod) bool
- func IsScheduled(pod *corev1.Pod) bool
- func IsStuckTerminating(pod *corev1.Pod, clk clock.Clock) bool
- func IsTerminal(pod *corev1.Pod) bool
- func IsTerminating(pod *corev1.Pod) bool
- func IsWaitingEviction(pod *corev1.Pod, clk clock.Clock) bool
- func ToleratesDisruptedNoScheduleTaint(pod *corev1.Pod) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FailedToSchedule ¶
FailedToSchedule ensures that the kube-scheduler has seen this pod and has intentionally marked this pod with a condition, noting that it thinks that the pod can't schedule anywhere It does this by marking the pod status condition "PodScheduled" as "Unschedulable" Note that it's possible that other schedulers may be scheduling another pod and may have a different semantic (e.g. Fargate on AWS marks with MATCH_NODE_SELECTOR_FAILED). If that's the case, Karpenter won't react to this pod because the scheduler didn't add this specific condition.
func HasDoNotDisrupt ¶
func HasPodAntiAffinity ¶
HasPodAntiAffinity returns true if a non-empty PodAntiAffinity is defined in the pod spec
func HasRequiredPodAntiAffinity ¶
HasRequiredPodAntiAffinity returns true if a non-empty PodAntiAffinity/RequiredDuringSchedulingIgnoredDuringExecution is defined in the pod spec
func IsActive ¶ added in v0.34.0
IsActive checks if Karpenter should consider this pod as running by ensuring that the pod: - Isn't a terminal pod (Failed or Succeeded) - Isn't actively terminating
func IsDisruptable ¶ added in v0.34.0
IsDisruptable checks if a pod can be disrupted based on validating the `karpenter.sh/do-not-disrupt` annotation on the pod. It checks whether the following is true for the pod: - Has the `karpenter.sh/do-not-disrupt` annotation - Is an actively running pod
func IsDrainable ¶ added in v1.0.0
IsDrainable checks if a pod can be drained by Karpenter by ensuring that the pod: - Doesn't tolerate the "karpenter.sh/disruption=disrupting" taint - Isn't a pod that has been terminating past its terminationGracePeriodSeconds - Isn't a mirror pod (https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/) Note: pods with the `karpenter.sh/do-not-disrupt` annotation are included since node drain should stall until these pods are evicted or become terminal, even though Karpenter won't orchestrate the eviction.
func IsEvictable ¶ added in v0.34.0
IsEvictable checks if a pod is evictable by Karpenter by ensuring that the pod: - Is an active pod (isn't terminal or actively terminating) - Doesn't tolerate the "karpenter.sh/disruption=disrupting" taint - Isn't a mirror pod (https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/) - Does not have the "karpenter.sh/do-not-disrupt=true" annotation (https://karpenter.sh/docs/concepts/disruption/#pod-level-controls)
func IsOwnedByDaemonSet ¶
func IsOwnedByNode ¶
IsOwnedByNode returns true if the pod is a static pod owned by a specific node
func IsOwnedByStatefulSet ¶ added in v0.34.0
func IsPreempting ¶
func IsProvisionable ¶
IsProvisionable checks if a pod needs to be scheduled to new capacity by Karpenter by ensuring that the pod: - Has been marked as "Unschedulable" in the PodScheduled reason by the kube-scheduler - Has not been bound to a node - Isn't currently preempting other pods on the cluster and about to schedule - Isn't owned by a DaemonSet - Isn't a mirror pod (https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/)
func IsReschedulable ¶ added in v0.34.0
IsReschedulable checks if a Karpenter should consider this pod when re-scheduling to new capacity by ensuring that the pod: - Is an active pod (isn't terminal or actively terminating) OR Is owned by a StatefulSet and Is Terminating - Isn't owned by a DaemonSet - Isn't a mirror pod (https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/)
func IsScheduled ¶
func IsStuckTerminating ¶ added in v0.34.0
func IsTerminal ¶
func IsTerminating ¶
func IsWaitingEviction ¶ added in v0.34.0
IsWaitingEviction checks if this is a pod that we are waiting to be removed from the node by ensuring that the pod: - Isn't a terminal pod (Failed or Succeeded) - Can be drained by Karpenter (See IsDrainable)
func ToleratesDisruptedNoScheduleTaint ¶ added in v1.0.0
ToleratesDisruptedNoScheduleTaint returns true if the pod tolerates karpenter.sh/disrupted:NoSchedule taint
Types ¶
This section is empty.