开篇几张图展示,
调度器:
预选策略: 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
支持的预选策略,版本不同,策略不同。
git官网文档:
https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/algorithmprovider/defaults/register_predicates.go
[root@k8s-master pki]# kubectl describe node k8s-node1 查看资源
优先函数:
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对象需求的已有镜像的体积大小之和 (最后三个函数默认不开启)
这三个优选函数默认不启用,前面的7个均可启用。
得分最高的,越好,优先级越高。
优选函数。
Git官网:https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/algorithmprovider/defaults/register_priorities.go
完成。
标签:优选,capacity,函数,kubernetes,预选,调度,Pod,spec From: https://www.cnblogs.com/sunnyyangwang/p/17558007.html