Scheduler
調度過程:
預選過程 predicate
優選策略 priority
選定 selectnode
節點親和性調度
反親和性函數
調度器:
預選策略:
CheckNodeCondition
GeneralPredicates
HostName: 檢查pod對象是否認義了pod.spec.hostname
PodFitsHostPorts: pods.spec.containers.ports.hostPort
MatchNodeSelector: pods.spec.nodeSelector
PodFitsResources: 檢查Pod資源需求可否被節點知足
kubectl describe node k8s-node1
NoDiskConflict 檢查節點是否有合適的能知足pod依賴的存儲卷
PodtoleratesNodeTaints: 檢查pod上的tolerations可容忍的污點是否徹底包含節點上的污點
PodToleratesNodeNoExecuteTains 默認沒有啓用
CheckNodeLabelPresence 檢查標籤的存在性 默認沒有啓用
CheckServiceAffinity 默認沒有啓用ui
MaxEBSVolumeCount MaxGCEPDVolumeCount MaxAzureDiskVolumeCount CheckVolumeBinding NovolumeZoneConflict CheckNodeMemoryPressure 檢查節點內存資源是否存在壓力 CheckNodePIDpressure 檢查節點PID資源是否存在壓力 CheckNodeDiskPressure 檢查節點磁盤是否存在壓力 MatchInterPodAffity
優選函數
LeastRequested:
(cpu((capacity-sum(requested))*10/capacity)code
BalancedResourceAllocation CPU和內存資源被佔用率相近的勝出 NodePreferAvoidPods 節點註解信息「scheduler.alpha.kubernetes.io/preferAvoidPods」 TaintToleration: 將Pod對象的spec.tolerations 與節點的taints列表項進行匹配度檢查,匹配的條目越多,得分越低 SelectorSpreading: 與當前pod對象同屬的標籤選擇器,匹配度越高得分越低 InterPodAffinity NodeAffinity 節點親和性 MostRequested NodeLabel ImageLocality: 根據已有鏡像的體積大小之和
高級調度設置:對象
節點選擇器: nodeSelector
節點親和調度:nodeAffinity
kubectl explain pods.spec.affinity.nodeAffinity內存
preferredDuringSchedulingIgnoredDuringExecution 軟親和性,若是能知足最好,若是實在不知足,也能夠 requiredDuringSchedulingIgnoredDuringExecution 硬親和性,必需要知足才行
taint的effect定義對pod的排斥效果:
NoSchedule 僅影響調度過程
NoExecute 既影響調度過程也影響現存的Pod對象;不容忍的Pod對象將比驅逐
PreferNoSchedule 不容忍的若是沒有其餘的選擇那麼也就能夠被保留ci
污點調度 taint: 給節點那些pod能被調度,通常用在節點上,也是一種鍵值屬性, taints資源
Tolerrations 容忍度kubernetes
admin Abc.1234it