1

在这个关于如何使用多个调度程序的K8s页面之后,我只能看到这在 pod 的规范schedulerName下发生的,尽管我不明白这是否特别针对单个 pod 进行了解释(因为 Pod 是最小的k8s 可部署对象),甚至当 pod 附加到部署或其他可部署资源时。就我而言,我有一个自定义调度程序,并且我希望它处理调度 Daemonset 对象。我尝试了两种选择:

一种。将spec.schedulerName: custom-schedulerdaemonset pod 的规格放在下面。

湾。将spec.schedulerName: custom-schedulerdaemonset 规范放在下面。

结果是:

一种。从 pods 事件可以看出,daemonset 的 pod 由自定义调度程序调度。

湾。daemonset 的 pod 由 kube-system 的默认调度程序调度。

我的问题是:

用户能否确定除 Pod 之外的可部署 k8s 对象的调度程序,例如 daemonset/deployment/replicas?如果不是,请解释为什么以及如何在内部工作。非常感谢您的见解。

4

1 回答 1

2
  • 当我检查 daemonset.spec 的文档时,我根本看不到schedulerName如下:
kubectl explain daemonset.spec
KIND:     DaemonSet
VERSION:  apps/v1

RESOURCE: spec <Object>

DESCRIPTION:
     The desired behavior of this daemon set. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status

     DaemonSetSpec is the specification of a daemon set.

FIELDS:
   minReadySeconds      <integer>
     The minimum number of seconds for which a newly created DaemonSet pod
     should be ready without any of its container crashing, for it to be
     considered available. Defaults to 0 (pod will be considered available as
     soon as it is ready).

   revisionHistoryLimit <integer>
     The number of old history to retain to allow rollback. This is a pointer to
     distinguish between explicit zero and not specified. Defaults to 10.

   selector     <Object> -required-
     A label query over pods that are managed by the daemon set. Must match in
     order to be controlled. It must match the pod template's labels. More info:
     https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

   template     <Object> -required-
     An object that describes the pod that will be created. The DaemonSet will
     create exactly one copy of this pod on every node that matches the
     template's node selector (or on every node if no node selector is
     specified). More info:
     https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template

   updateStrategy       <Object>
     An update strategy to replace existing DaemonSet pods with new pods.
  • 它仅适用于 pod.spec(我的 kubernetes 版本是 19.4)
于 2022-01-17T14:11:16.010 回答