调度器:
预选策略:
CheckNodeCondition:
GeneralPredicates
HostName: 检查pod对象是否定义了pod.spec.hostname;
PodFitsHostPorts:
MatchNodeSelector:
PodFitsResources: 检查pod的资源需求是否能被节点所满足;
NoDiskConflict: 检查pod依赖的存储卷是否能满足需求;
PodToleratesNodeTaints: 检查pod上的spec.tolerations能够容忍的污点能否完全包含节点上的污点;
PodToleratesNodeNoExecuteTaints: 不能容忍的污点,默认不启用
CheckNodeLabelPresence: 检查标签的存在性;
CheckServiceAffinity: 将pod调度到他所属的service其他pod已经调度完成的节点上, 默认没有启用
MaxEBSVolumeCount
MAXGCEPDvolumeCount
MAXAzureDiskVolumeCount
CheckVolumeBinding: 检查pvc
NoVolumeZoneConflict:
CheckNodeMemoryPressure: 检查节点内存资源是否处于压力过大的状态;
CheckNodePIDPressure: 检查节点PID进程量过多问题
CheckNodeDiskPressure:
MatchInterPodAffinity: 检查满足的亲和性或非亲和性
优选函数:
LeastRequested: 根据空闲比率来评估的;
cpu((capacity-sum(requested))*10/capacity) + memory((capacity-sum(requested))*10/capacity)
BalancedResourceAllocation:
与CPU和内存的占用率相近的胜出;
NodePreferAvoidPods:
根据节点的注解信息"scheduler.alpha.kubernetes.io/preferAvoidPods"
TainToleration:
将pod对象的spec.tolerations列表项与节点的taints列表项进行匹配度检查,匹配条目越多,得分越多
SeletorSpreading: 与此pod当前pod对象同属的标签选择器选择的节点,匹配越多得分越低;
InterPodAffinity:
NodeAffinity: 节点亲和性
MostRequested: LeastRequested计算值越小越优先
NodeLabel: 根据节点标签评估得分的
ImageLocality: 根据满足当前Pod对象需求的已有镜像的体积大小评估得分
kubernetes高级调度方式
节点选择器: nodeselector, nodename
节点亲和调度: nodeAffinity
nodeselector: 精确匹配
nodeAffinity:
kubectl explain pods.spec.affinity.nodeAffinity
preferredDuringSchedulingIgnoredDuringExecution --软亲和性
requiredDuringSchedulingIgnoredDuringExecution --硬亲和性
污点:
每一个污点都必须被容忍, 不能容忍需要根据参数调度;
NoSchedule: 仅影响调度过程,对现存的Pod对象不产生影响;
NoExecute: 既影响调度过程,也影响现存的Pod对象,不容忍的Pod对象将被驱逐;
PreferNoSchedule:
修改节点上的污点:
kubectl taint Node name key=value:TAINT