客户端 请求 apiserver ------> shceduler ------- node(kubelet或kube-proxy) 请求 apiserver 来进行pod和service创建,iptable和ipvs规则改写
调度器 先进行预选再进行优选 ,最后进行select
调度器:
预选策略:
CheckNodeCondition:
GeneralPredicates
HostName:检查Pod对象是否定义了pod.spec.hostname,
PodFitsHostPorts:pods.spec.containers.ports.hostPort
MatchNodeSelector:pods.spec.nodeSelector
PodFitsResources:检查Pod的资源需求是否能被节点所满足;
NoDiskConflict:检查Pod依赖的存储卷是否能满足需求;
PodToleratesNodeTaints:检查Pod上的spec.tolerations可容忍的污点是否完全包含节点上的污点;
PodToleratesNodeNoExecuteTaints:
CheckNodeLabelPresence:
CheckServiceAffinity:
MaxEBSVolumeCount
MaxGCEPDVolumeCount
MaxAzureDiskVolumeCount
CheckVolumeBinding:
NoVolumeZoneConflict:
CheckNodeMemoryPressure
CheckNodePIDPressure
CheckNodeDiskPressure
MatchInterPodAffinity
优先函数:
LeastRequested:
(cpu((capacity-sum(requested))*10/capacity)+memory((capacity-sum(requested))*10/capacity))/2
BalancedResourceAllocation:
CPU和内存资源被占用率相近的胜出;
NodePreferAvoidPods:
节点注解信息“scheduler.alpha.kubernetes.io/preferAvoidPods”
TaintToleration:将Pod对象的spec.tolerations列表项与节点的taints列表项进行匹配度检查,匹配条目越,
得分越低;
SeletorSpreading:
InterPodAffinity:
NodeAffinity:
MostRequested:
NodeLabel:
ImageLocality:根据满足当前Pod对象需求的已有镜像的体积大小之和
节点选择器:nodeSelector, nodeName
节点亲和调度:nodeAffinity
原文地址:https://www.cnblogs.com/leleyao/p/10591397.html