Kubernetes Scheduler Extenders——它们什么时候被调用?

Kubernetes Scheduler Extenders - when are they invoked?

从K8s v1.18开始,我们将调度上下文分为调度周期和绑定周期,并带有多个扩展点。

我对这方面的调度程序扩展程序有疑问。它们是在调度周期之后和绑定周期之前调用的吗?

非常感谢任何帮助!

谢谢!

它们作为调度决策的最后一步被调用,它选择在 pod 规范中具有特定 schedulerName 的 pods。数字 3 here:

(3) implementing a "scheduler extender" process that the standard Kubernetes scheduler calls out to as a final pass when making scheduling decisions.

因此,如果您的调度程序名称是 my-scheduler,那么 pod 规范将如下所示:

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  schedulerName: my-scheduler  
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80

在日志中它会这样显示:

$ kubectl describe pod test-pod
Name:         test-pod
...
Events:
  Type    Reason                 Age   From               Message
  ----    ------                 ----  ----               -------
  Normal  Scheduled              25s   my-scheduler    Successfully assigned test-pod to minikube