Documentation ¶
Index ¶
- Constants
- func NewCoscheduler(_ *runtime.Unknown, handle framework.FrameworkHandle) (framework.Plugin, error)
- type Coscheduler
- func (c *Coscheduler) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (c *Coscheduler) Less(podInfo1, podInfo2 *framework.PodInfo) bool
- func (c *Coscheduler) Name() string
- func (c *Coscheduler) PostBind(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
- func (c *Coscheduler) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
- func (c *Coscheduler) PreFilterExtensions() framework.PreFilterExtensions
- type InsufficientResource
- type PodGroupInfo
Constants ¶
const ( // CoschedulerName is the name of the plugin used in the plugin registry and configurations. CoschedulerName = "CoschedulerSamenode" // PodGroupName is the name of a pod group that mark pods which should be scheduler to same node. PodGroupName = "pod-group.scheduling.sigs.k8s.io/name" // PodGroupTotal is the number of pods in the pod group PodGroupTotal = "pod-group.scheduling.sigs.k8s.io/total" )
Variables ¶
This section is empty.
Functions ¶
func NewCoscheduler ¶
NewCoscheduler initializes a new plugin and returns it.
Types ¶
type Coscheduler ¶
type Coscheduler struct {
// contains filtered or unexported fields
}
Coscheduler is a plugin that checks if a node has sufficient resources.
func (*Coscheduler) Filter ¶
func (c *Coscheduler) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *schedulernodeinfo.NodeInfo) *framework.Status
Filter invoked at the filter extension point. Checks if a node has sufficient resources, such as cpu, memory, gpu, opaque int resources etc to run a pod. It returns a list of insufficient resources, if empty, then the node has all the resources requested by the pod.
func (*Coscheduler) Less ¶
func (c *Coscheduler) Less(podInfo1, podInfo2 *framework.PodInfo) bool
Less is used to sort pods in the scheduling queue. 1. Compare the priorities of Pods. 2. Compare the initialization timestamps of PodGroups/Pods. 3. Compare the keys of PodGroups/Pods, i.e., if two pods are tied at priority and creation time, the one without podGroup will go ahead of the one with podGroup.
func (*Coscheduler) Name ¶
func (c *Coscheduler) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*Coscheduler) PostBind ¶
func (c *Coscheduler) PostBind(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
PostBind is to clear Pginfo when every pod in the group is binded.
func (*Coscheduler) PreFilter ¶
func (c *Coscheduler) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter invoked at the prefilter extension point.
func (*Coscheduler) PreFilterExtensions ¶
func (c *Coscheduler) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
type InsufficientResource ¶
type InsufficientResource struct { ResourceName v1.ResourceName // We explicitly have a parameter for reason to avoid formatting a message on the fly // for common resources, which is expensive for cluster autoscaler simulations. Reason string Requested int64 Used int64 Capacity int64 }
InsufficientResource describes what kind of resource limit is hit and caused the pod to not fit the node.
type PodGroupInfo ¶
type PodGroupInfo struct {
// contains filtered or unexported fields
}
PodGroupInfo is a wrapper to a PodGroup with additional information. A PodGroup's priority, timestamp are set according to the values of the PodGroup's first pod that is added to the scheduling queue.