pod

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailedToSchedule

func FailedToSchedule(pod *v1.Pod) bool

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 HasDoNotDisrupt(pod *v1.Pod) bool

func HasPodAntiAffinity

func HasPodAntiAffinity(pod *v1.Pod) bool

HasPodAntiAffinity returns true if a non-empty PodAntiAffinity is defined in the pod spec

func HasRequiredPodAntiAffinity

func HasRequiredPodAntiAffinity(pod *v1.Pod) bool

HasRequiredPodAntiAffinity returns true if a non-empty PodAntiAffinity/RequiredDuringSchedulingIgnoredDuringExecution is defined in the pod spec

func IsActive added in v0.34.0

func IsActive(pod *v1.Pod) bool

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

func IsDisruptable(pod *v1.Pod) bool

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 IsEvictable added in v0.34.0

func IsEvictable(pod *v1.Pod) bool

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/)

func IsOwnedBy

func IsOwnedBy(pod *v1.Pod, gvks []schema.GroupVersionKind) bool

func IsOwnedByDaemonSet

func IsOwnedByDaemonSet(pod *v1.Pod) bool

func IsOwnedByNode

func IsOwnedByNode(pod *v1.Pod) bool

IsOwnedByNode returns true if the pod is a static pod owned by a specific node

func IsOwnedByStatefulSet added in v0.34.0

func IsOwnedByStatefulSet(pod *v1.Pod) bool

func IsPreempting

func IsPreempting(pod *v1.Pod) bool

func IsProvisionable

func IsProvisionable(pod *v1.Pod) bool

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

func IsReschedulable(pod *v1.Pod) bool

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 IsScheduled(pod *v1.Pod) bool

func IsStuckTerminating added in v0.34.0

func IsStuckTerminating(pod *v1.Pod, clk clock.Clock) bool

func IsTerminal

func IsTerminal(pod *v1.Pod) bool

func IsTerminating

func IsTerminating(pod *v1.Pod) bool

func IsWaitingEviction added in v0.34.0

func IsWaitingEviction(pod *v1.Pod, clk clock.Clock) bool

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) - Isn't a pod that has been terminating past its terminationGracePeriodSeconds - Doesn't tolerate the "karpenter.sh/disruption=disrupting" taint - Isn't a mirror pod (https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/)

func ToleratesDisruptionNoScheduleTaint

func ToleratesDisruptionNoScheduleTaint(pod *v1.Pod) bool

ToleratesDisruptionNoScheduleTaint returns true if the pod tolerates karpenter.sh/disruption:NoSchedule=Disrupting taint

Types

This section is empty.

Jump to

Keyboard shortcuts

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