Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PodSafeToEvictKey - annotation that ignores constraints to evict a pod like not being replicated, being on // kube-system namespace or having a local storage. PodSafeToEvictKey = "cluster-autoscaler.kubernetes.io/safe-to-evict" // SafeToEvictLocalVolumesKey - annotation that ignores (doesn't block on) a local storage volume during node scale down SafeToEvictLocalVolumesKey = "cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes" )
View Source
const ( // PodLongTerminatingExtraThreshold - time after which a pod, that is terminating and that has run over its terminationGracePeriod, should be ignored and considered as deleted PodLongTerminatingExtraThreshold = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ControllerRef ¶
func ControllerRef(pod *apiv1.Pod) *metav1.OwnerReference
ControllerRef returns the OwnerReference to pod's controller.
func HasBlockingLocalStorage ¶
HasBlockingLocalStorage returns true if pod has any local storage without pod annotation `<SafeToEvictLocalVolumeKey>: <volume-name-1>,<volume-name-2>...`
Types ¶
type BlockingPod ¶
type BlockingPod struct { Pod *apiv1.Pod Reason BlockingPodReason }
BlockingPod represents a pod which is blocking the scale down of a node.
func GetPodsForDeletionOnNodeDrain ¶
func GetPodsForDeletionOnNodeDrain( podList []*apiv1.Pod, pdbs []*policyv1.PodDisruptionBudget, skipNodesWithSystemPods bool, skipNodesWithLocalStorage bool, skipNodesWithCustomControllerPods bool, listers kube_util.ListerRegistry, minReplica int32, currentTime time.Time) (pods []*apiv1.Pod, daemonSetPods []*apiv1.Pod, blockingPod *BlockingPod, err error)
GetPodsForDeletionOnNodeDrain returns pods that should be deleted on node drain as well as some extra information about possibly problematic pods (unreplicated and DaemonSets).
type BlockingPodReason ¶
type BlockingPodReason int
BlockingPodReason represents a reason why a pod is blocking the scale down of a node.
const ( // NoReason - sanity check, this should never be set explicitly. If this is found in the wild, it means that it was // implicitly initialized and might indicate a bug. NoReason BlockingPodReason = iota // ControllerNotFound - pod is blocking scale down because its controller can't be found. ControllerNotFound // MinReplicasReached - pod is blocking scale down because its controller already has the minimum number of replicas. MinReplicasReached // NotReplicated - pod is blocking scale down because it's not replicated. NotReplicated // LocalStorageRequested - pod is blocking scale down because it requests local storage. LocalStorageRequested // NotSafeToEvictAnnotation - pod is blocking scale down because it has a "not safe to evict" annotation. NotSafeToEvictAnnotation // UnmovableKubeSystemPod - pod is blocking scale down because it's a non-daemonset, non-mirrored, non-pdb-assigned kube-system pod. UnmovableKubeSystemPod // NotEnoughPdb - pod is blocking scale down because it doesn't have enough PDB left. NotEnoughPdb // UnexpectedError - pod is blocking scale down because of an unexpected error. UnexpectedError )
Click to show internal directories.
Click to hide internal directories.