当前位置: 首页 > news >正文

加强企业网站建设有人从搜索引擎找网站建设吗

加强企业网站建设,有人从搜索引擎找网站建设吗,东莞网站建设地点优化,网站建设捌金手指下拉二八查看案例 字段含义podAffinityPod 间的亲和性定义podAntiAffinityPod 间的反亲和性定义requiredDuringSchedulingIgnoredDuringExecution硬性要求#xff0c;必须满足条件#xff0c;保证分散部署的效果最好使用用此方式preferredDuringSchedulingIgnoredDuringExecution软性…查看案例 字段含义podAffinityPod 间的亲和性定义podAntiAffinityPod 间的反亲和性定义requiredDuringSchedulingIgnoredDuringExecution硬性要求必须满足条件保证分散部署的效果最好使用用此方式preferredDuringSchedulingIgnoredDuringExecution软性要求可以不完全满足即有可能同一node上可以跑多个副本requiredDuringSchedulingIgnoredDuringExecutionlabelSelectortopologyKeypreferredDuringSchedulingIgnoredDuringExecutionweightpodAffinityTermlabelSelectortopologyKeytopologyKey可以理解为 Node 的 Label具有相同的 Label 的 Node视为同一拓扑如三个节点打上 Label - Node1 —— zonebeijing- Node2 —— zoneshanghai- Node3 —— zonebeijing那么 Node1 和 Node3 为同一拓扑Node2 为另一拓扑topologyKey: kubernetes.io/hostname上面为常见的配置可以通过 kubectl get nodes --show-labels看到节点上的 Lable就具有此 kubernetes.io/hostname Label因此就是将每个节点作为一个独立的拓扑 apiVersion: v1 kind: Pod metadata:name: test-pod spec:affinity:# 首先根据 labelSelector 选择具有 service.cpaas.io/name: deployment-nginx Label 的 所有 Pod# 接下来根据 podAffinity 亲和性将此 pod 调度到与选中 Pod 中具有 topologyKey 的 Node 上podAffinity:requiredDuringSchedulingIgnoredDuringExecution:- labelSelector:matchLabels:service.cpaas.io/name: deployment-nginxtopologyKey: kubernetes.io/hostname- labelSelector:matchLabels:service.cpaas.io/name: deployment-busyboxtopologyKey: kubernetes.io/hostname# 首先根据 labelSelector 选择具有 key 为 a value为 b 或 c 的 Label 的 Pod# 接下来根据 podAntiAffinity将此 pod 调度到与选中 Pod 中都不相同的 Node 上该节点需要具有 topologyKey labelpodAntiAffinity:preferredDuringSchedulingIgnoredDuringExecution:- weight: 100podAffinityTerm:labelSelector:matchExpressions:- key: aoperator: Invalues: [b, c]topologyKey: kubernetes.io/hostnamecontainers:- name: test-podimage: nginx:1.18 代码分析 代码路径pkg/scheduler/framework/plugins/interpodaffinity 首先根据调度器框架观察源码可以看出实现了一下四个接口 PreFilterFilterPreScoreScore 首先明确几点 该插件是考虑 Pod 间的亲和性和反亲和性就是新Pod 和 现存 Pod 的关系但最终结果是将 Pod 调度到合适的 Node 上因此要记录 Node 的信息 1 | PreFilter 此步骤作用 梳理出【现存哪些 Pod】 讨厌【新 Pod】记录【满足条件的现存 Pod】 对应 Node 信息为 existingPodAntiAffinityMap梳理出【新 Pod】喜欢【哪些现存Pod】记录【满足条件的现存 Pod】 对应 Node 信息为 incomingPodAffinityMap梳理出【新 Pod】讨厌【哪些现存Pod】记录【满足条件的现存 Pod】 对应 Node 信息为 incomingPodAntiAffinityMap 所以可以小总结一下 existingPodAntiAffinityMap 和 incomingPodAntiAffinityMap 这些记录的节点新 Pod 不喜欢incomingPodAffinityMap 记录的节点Pod 喜欢 问题 —— 为什么不梳理 【现存哪些 Pod】 喜欢【新 Pod】 因为现在是调度【新 Pod】只要不被讨厌不影响【现存 Pod 】就行因此只需要可能会影响的【现存 Pod】 注意上面所说的【条件】—— 指的是【硬性要求 requiredDuringSchedulingIgnoredDuringExecution 】 —— 因此才考虑这么详细 // 这里只截取了 PreFilter 部分重要函数 // pkg/scheduler/framework/plugins/interpodaffinity/filtering.go// 考虑现存 Pod 的 反亲和性 anti-affinity // 简单理解就是用现存 Pod 的 anti-affinity Terms 配置要求 NewPod记录下满足的 Node说明这些节点不能调度因为现存 Pod 排斥新 Pod // 这里的 anti-affinity Terms 是指 requiredDuringSchedulingIgnoredDuringExecution 定义的硬性要求 // 问题为什么不考虑现存 Pod 的亲和性 —— 因为现存 Pod 的亲和性是亲和他之前 Pod在其调度的时候早已考虑现在只需要考虑其反感的 // 代码级理解 // 1. 遍历所有具有 anti-affinity 现存 Pod // 2. 若即将调度的 NewPod 满足该 Pod 的 anti-affnity Terms // 3. 就记录到 existingPodAntiAffinityMap 中key 为该 Pod 所在的 node 信息topologyKey、topologyValuevalue 为满足的 Terms 次数 // 例如 map{hostnamenode011} // existingPodAntiAffinityMap will be used later for efficient check on existing pods anti-affinity existingPodAntiAffinityMap : getTPMapMatchingExistingAntiAffinity(pod, nodesWithRequiredAntiAffinityPods)// 考虑新 NewPod 的亲和性和反亲和性 // 简单理解 就是用 NewPod 的 anti-affinity 和 affinity Terms 配置要求现存的 Pod记录下满足的 Node // incomingPodAffinityMap will be used later for efficient check on incoming pods affinity // incomingPodAntiAffinityMap will be used later for efficient check on incoming pods anti-affinity incomingPodAffinityMap, incomingPodAntiAffinityMap : getTPMapMatchingIncomingAffinityAntiAffinity(podInfo, allNodes)2 | Filter *framework.CycleState 将上面统计的信息传递过来现在的工作就是 传来了一个 Node 信息判断该 Node 与上面的 existingPodAntiAffinityMap、incomingPodAntiAffinityMap 、incomingPodAffinityMap 的关系若该 Node 满足条件那么可以进入到下面的【打分阶段】 // pkg/scheduler/framework/plugins/interpodaffinity/filtering.go func (pl *InterPodAffinity) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {if nodeInfo.Node() nil {return framework.NewStatus(framework.Error, node not found)}state, err : getPreFilterState(cycleState)if err ! nil {return framework.NewStatus(framework.Error, err.Error())}if !satisfyPodAffinity(state, nodeInfo) {return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonAffinityNotMatch, ErrReasonAffinityRulesNotMatch)}if !satisfyPodAntiAffinity(state, nodeInfo) {return framework.NewStatus(framework.Unschedulable, ErrReasonAffinityNotMatch, ErrReasonAntiAffinityRulesNotMatch)}if !satisfyExistingPodsAntiAffinity(state, nodeInfo) {return framework.NewStatus(framework.Unschedulable, ErrReasonAffinityNotMatch, ErrReasonExistingAntiAffinityRulesNotMatch)}return nil }3 | PreScore 这部分主要看 processExistingPod 函数 可以看出根据【现存 Pod】 和【新 Pod】的【软性要求preferredDuringSchedulingIgnoredDuringExecution】对节点进行打分 // pkg/scheduler/framework/plugins/interpodaffinity/scoring.go // PreScore builds and writes cycle state used by Score and NormalizeScore. func (pl *InterPodAffinity) PreScore(pCtx context.Context,cycleState *framework.CycleState,pod *v1.Pod,nodes []*v1.Node, ) *framework.Status {// ... ...topoScores : make([]scoreMap, len(allNodes))index : int32(-1)processNode : func(i int) {nodeInfo : allNodes[i]if nodeInfo.Node() nil {return}// Unless the pod being scheduled has affinity terms, we only// need to process pods with affinity in the node.podsToProcess : nodeInfo.PodsWithAffinityif hasAffinityConstraints || hasAntiAffinityConstraints {// We need to process all the pods.podsToProcess nodeInfo.Pods}topoScore : make(scoreMap)for _, existingPod : range podsToProcess {pl.processExistingPod(state, existingPod, nodeInfo, pod, topoScore)}if len(topoScore) 0 {topoScores[atomic.AddInt32(index, 1)] topoScore}}parallelize.Until(context.Background(), len(allNodes), processNode)for i : 0; i int(index); i {state.topologyScore.append(topoScores[i])}cycleState.Write(preScoreStateKey, state)return nil }func (pl *InterPodAffinity) processExistingPod(state *preScoreState,existingPod *framework.PodInfo,existingPodNodeInfo *framework.NodeInfo,incomingPod *v1.Pod,topoScore scoreMap, ) {existingPodNode : existingPodNodeInfo.Node()// For every soft pod affinity term of pod, if existingPod matches the term,// increment p.counts for every node in the cluster with the same term.TopologyKey// value as that of existingPodss node by the terms weight.topoScore.processTerms(state.podInfo.PreferredAffinityTerms, existingPod.Pod, existingPodNode, 1)// For every soft pod anti-affinity term of pod, if existingPod matches the term,// decrement p.counts for every node in the cluster with the same term.TopologyKey// value as that of existingPods node by the terms weight.topoScore.processTerms(state.podInfo.PreferredAntiAffinityTerms, existingPod.Pod, existingPodNode, -1)// For every hard pod affinity term of existingPod, if pod matches the term,// increment p.counts for every node in the cluster with the same term.TopologyKey// value as that of existingPods node by the constant args.hardPodAffinityWeightif pl.args.HardPodAffinityWeight 0 {for _, term : range existingPod.RequiredAffinityTerms {t : framework.WeightedAffinityTerm{AffinityTerm: term, Weight: pl.args.HardPodAffinityWeight}topoScore.processTerm(t, incomingPod, existingPodNode, 1)}}// For every soft pod affinity term of existingPod, if pod matches the term,// increment p.counts for every node in the cluster with the same term.TopologyKey// value as that of existingPods node by the terms weight.topoScore.processTerms(existingPod.PreferredAffinityTerms, incomingPod, existingPodNode, 1)// For every soft pod anti-affinity term of existingPod, if pod matches the term,// decrement pm.counts for every node in the cluster with the same term.TopologyKey// value as that of existingPods node by the terms weight.topoScore.processTerms(existingPod.PreferredAntiAffinityTerms, incomingPod, existingPodNode, -1) }4 | Score 这部分就是将节点的得分进行累计计算返回此符合条件的节点的得分数 注意所有符合条件都会调用此函数得到自己对应的分数 // pkg/scheduler/framework/plugins/interpodaffinity/scoring.go // Score invoked at the Score extension point. // The score returned in this function is the sum of weights got from cycleState which have its topologyKey matching with the nodes labels. // it is normalized later. // Note: the returned score is positive for pod-affinity, and negative for pod-antiaffinity. func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {nodeInfo, err : pl.sharedLister.NodeInfos().Get(nodeName)if err ! nil || nodeInfo.Node() nil {return 0, framework.NewStatus(framework.Error, fmt.Sprintf(getting node %q from Snapshot: %v, node is nil: %v, nodeName, err, nodeInfo.Node() nil))}node : nodeInfo.Node()s, err : getPreScoreState(cycleState)if err ! nil {return 0, framework.NewStatus(framework.Error, err.Error())}var score int64for tpKey, tpValues : range s.topologyScore {if v, exist : node.Labels[tpKey]; exist {score tpValues[v]}}return score, nil }
文章转载自:
http://www.morning.lmxrt.cn.gov.cn.lmxrt.cn
http://www.morning.rnzjc.cn.gov.cn.rnzjc.cn
http://www.morning.dqkcn.cn.gov.cn.dqkcn.cn
http://www.morning.yckwt.cn.gov.cn.yckwt.cn
http://www.morning.trfrl.cn.gov.cn.trfrl.cn
http://www.morning.xfmwk.cn.gov.cn.xfmwk.cn
http://www.morning.pkrb.cn.gov.cn.pkrb.cn
http://www.morning.jtmrx.cn.gov.cn.jtmrx.cn
http://www.morning.nynpf.cn.gov.cn.nynpf.cn
http://www.morning.bfmq.cn.gov.cn.bfmq.cn
http://www.morning.yhrfg.cn.gov.cn.yhrfg.cn
http://www.morning.crhd.cn.gov.cn.crhd.cn
http://www.morning.wxlzr.cn.gov.cn.wxlzr.cn
http://www.morning.ydnxm.cn.gov.cn.ydnxm.cn
http://www.morning.tlrxt.cn.gov.cn.tlrxt.cn
http://www.morning.kcbml.cn.gov.cn.kcbml.cn
http://www.morning.lmjtp.cn.gov.cn.lmjtp.cn
http://www.morning.ssxlt.cn.gov.cn.ssxlt.cn
http://www.morning.snmsq.cn.gov.cn.snmsq.cn
http://www.morning.zkjqj.cn.gov.cn.zkjqj.cn
http://www.morning.nfzw.cn.gov.cn.nfzw.cn
http://www.morning.dpsgq.cn.gov.cn.dpsgq.cn
http://www.morning.rhmk.cn.gov.cn.rhmk.cn
http://www.morning.ynlbj.cn.gov.cn.ynlbj.cn
http://www.morning.bzlfw.cn.gov.cn.bzlfw.cn
http://www.morning.ljfjm.cn.gov.cn.ljfjm.cn
http://www.morning.kpfds.cn.gov.cn.kpfds.cn
http://www.morning.dgsx.cn.gov.cn.dgsx.cn
http://www.morning.llyqm.cn.gov.cn.llyqm.cn
http://www.morning.thjqk.cn.gov.cn.thjqk.cn
http://www.morning.hkpyp.cn.gov.cn.hkpyp.cn
http://www.morning.rzbcz.cn.gov.cn.rzbcz.cn
http://www.morning.xqkjp.cn.gov.cn.xqkjp.cn
http://www.morning.fhntj.cn.gov.cn.fhntj.cn
http://www.morning.ymqrc.cn.gov.cn.ymqrc.cn
http://www.morning.tpxgm.cn.gov.cn.tpxgm.cn
http://www.morning.cwgn.cn.gov.cn.cwgn.cn
http://www.morning.srrrz.cn.gov.cn.srrrz.cn
http://www.morning.divocn.com.gov.cn.divocn.com
http://www.morning.hylbz.cn.gov.cn.hylbz.cn
http://www.morning.lksgz.cn.gov.cn.lksgz.cn
http://www.morning.kxwsn.cn.gov.cn.kxwsn.cn
http://www.morning.tqrxm.cn.gov.cn.tqrxm.cn
http://www.morning.mmkrd.cn.gov.cn.mmkrd.cn
http://www.morning.cbqqz.cn.gov.cn.cbqqz.cn
http://www.morning.xyhql.cn.gov.cn.xyhql.cn
http://www.morning.lhrcr.cn.gov.cn.lhrcr.cn
http://www.morning.rfljb.cn.gov.cn.rfljb.cn
http://www.morning.mbrbk.cn.gov.cn.mbrbk.cn
http://www.morning.zdkzj.cn.gov.cn.zdkzj.cn
http://www.morning.jydky.cn.gov.cn.jydky.cn
http://www.morning.pfjbn.cn.gov.cn.pfjbn.cn
http://www.morning.fmrd.cn.gov.cn.fmrd.cn
http://www.morning.snktp.cn.gov.cn.snktp.cn
http://www.morning.nkkpp.cn.gov.cn.nkkpp.cn
http://www.morning.wkmpx.cn.gov.cn.wkmpx.cn
http://www.morning.svrud.cn.gov.cn.svrud.cn
http://www.morning.gzzxlp.com.gov.cn.gzzxlp.com
http://www.morning.wfwqr.cn.gov.cn.wfwqr.cn
http://www.morning.sxtdh.com.gov.cn.sxtdh.com
http://www.morning.rmpfh.cn.gov.cn.rmpfh.cn
http://www.morning.jpydf.cn.gov.cn.jpydf.cn
http://www.morning.nrfqd.cn.gov.cn.nrfqd.cn
http://www.morning.dplmq.cn.gov.cn.dplmq.cn
http://www.morning.jqhrk.cn.gov.cn.jqhrk.cn
http://www.morning.kbqws.cn.gov.cn.kbqws.cn
http://www.morning.stpkz.cn.gov.cn.stpkz.cn
http://www.morning.jqlx.cn.gov.cn.jqlx.cn
http://www.morning.hpggl.cn.gov.cn.hpggl.cn
http://www.morning.nyqzz.cn.gov.cn.nyqzz.cn
http://www.morning.rflcy.cn.gov.cn.rflcy.cn
http://www.morning.qsxxl.cn.gov.cn.qsxxl.cn
http://www.morning.qnyf.cn.gov.cn.qnyf.cn
http://www.morning.tbqdm.cn.gov.cn.tbqdm.cn
http://www.morning.bnfjh.cn.gov.cn.bnfjh.cn
http://www.morning.lbrwm.cn.gov.cn.lbrwm.cn
http://www.morning.nxfuke.com.gov.cn.nxfuke.com
http://www.morning.bswxt.cn.gov.cn.bswxt.cn
http://www.morning.tkyry.cn.gov.cn.tkyry.cn
http://www.morning.pcxgj.cn.gov.cn.pcxgj.cn
http://www.tj-hxxt.cn/news/272268.html

相关文章:

  • 宁夏建网站报价wordpress英文版 菜单
  • 网站建设总结体会wordpress 手机端主题
  • 重庆市建设项目环境申报表网站wordpress 批量上传产品
  • 网站建设的售后装修公司网站 源码
  • 营销型网站传统网站html基本结构框架代码
  • 如何自己做框架开发网站东营城镇建设规划网站
  • go 做视频网站微擎做网站费用
  • 网站开发员岗位职责网站怎么做好 优帮云
  • 网站服务器容器网站建设-信科网络
  • jquery在网站开发实例运用代理公司注册手续
  • dw做的网站能直接使用吗a5做网站
  • 建设互联网站机房需要哪些设备东莞专业做网站建设服务
  • 网站页面下载嘉定建站公司
  • 济南搜索引擎优化网站微信小程序游戏修改器
  • 在网站上做教育直播平台多少钱最好的开发网站建设
  • 网站名称搜索不到南通 网站建设
  • 做网站的搜索引擎建设实业公司网站设计模板
  • 腾讯建站官网新手做哪类网站
  • 深圳网站公司招聘网站维护工单
  • 一站式网络营销网站流量工具
  • 咨询聊城做网站拿word如何做网站
  • 响应网站建设门户网站微信服务号建设方案
  • 中国建设银行云南官网站纪念币万户做网站怎么样
  • 做网站的大创结项网站建设江苏百拓
  • 网站建设建站培训wordpress信息流主题
  • 有什么做设计接任务的网站深圳海外医疗网站建设
  • 嘉定专业网站建设国内时事新闻
  • 国家外汇管理局网站怎么做报告怎么自己做网页
  • 计算机网络网站开发二级域名网站免费申请
  • 成都专业的网站设计公司asp做网站简介页面