1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
type Framework interface { Handle QueueSortFunc() LessFunc RunPreFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod) *Status RunPostFilterPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, filteredNodeStatusMap NodeToStatusMap) (*PostFilterResult, *Status) RunPreBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status RunPostBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) RunReservePluginsReserve(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status RunReservePluginsUnreserve(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) RunPermitPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status WaitOnPermit(ctx context.Context, pod *v1.Pod) *Status RunBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status HasFilterPlugins() bool HasPostFilterPlugins() bool HasScorePlugins() bool ListPlugins() *config.Plugins ProfileName() string }
Schedule()--> g.findNodesThatFitPod(ctx, extenders, fwk, state, pod)--> s := fwk.RunPreFilterPlugins(ctx, state, pod) g.findNodesThatPassFilters(ctx, fwk, state, pod, diagnosis, allNodes)--> fwk.RunFilterPluginsWithNominatedPods(ctx, state, pod, nodeInfo)--> s, err := getPreFilterState(cycleState) insufficientResources := fitsRequest(s, nodeInfo, f.ignoredResources, f.ignoredResourceGroups) findNodesThatPassExtenders(extenders, pod, feasibleNodes, diagnosis.NodeToStatusMap) prioritizeNodes(ctx, extenders, fwk, state, pod, feasibleNodes)--> fwk.RunPreScorePlugins(ctx, state, pod, nodes) fwk.RunScorePlugins(ctx, state, pod, nodes)--> f.runScorePlugin(ctx, pl, state, pod, nodeName) extenders[extIndex].Prioritize(pod, nodes) g.selectHost(priorityList) sched.assume(assumedPod, scheduleResult.SuggestedHost)--> sched.SchedulerCache.AssumePod(assumed)--> fwk.RunReservePluginsReserve(schedulingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost)--> f.runReservePluginReserve(ctx, pl, state, pod, nodeName) runPermitStatus := fwk.RunPermitPlugins(schedulingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost)--> f.runPermitPlugin(ctx, pl, state, pod, nodeName) fwk.RunPreBindPlugins(bindingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost) sched.bind(bindingCycleCtx, fwk, assumedPod, scheduleResult.SuggestedHost, state)--> f.runBindPlugin(ctx, bp, state, pod, nodeName)--> b.handle.ClientSet().CoreV1().Pods(binding.Namespace).Bind(ctx, binding, metav1.CreateOptions{})--> return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error()
|