Scheduler 是整个 kube-scheduler 的一个 structure,提供了 kube-scheduler 运行所需的组件。
[code]type Scheduler struct { // Cache是一个抽象,会缓存pod的信息,作为scheduler进行查找,操作是基于Pod进行增加 Cache internalcache.Cache // Extenders 算是调度框架中提供的调度插件,会影响kubernetes中的调度策略 Extenders []framework.Extender // NextPod 作为一个函数提供,会阻塞获取下一个ke'diao'du NextPod func() *framework.QueuedPodInfo // Error is called if there is an error. It is passed the pod in // question, and the error Error func(*framework.QueuedPodInfo, error) // SchedulePod 尝试将给出的pod调度到Node。 SchedulePod func(ctx context.Context, fwk framework.Framework, state *framework.CycleState, pod *v1.Pod) (ScheduleResult, error) // 关闭scheduler的信号 StopEverything