Documentation
¶
Index ¶
- Constants
- func New(cfg runtime.Object, f framework.FrameworkHandle) (framework.Plugin, error)
- type Args
- type NoOp
- type PodGroupManager
- type PodGroupNameSlice
- func (p PodGroupNameSlice) Add(r ...labels.Requirement) labels.Selector
- func (p PodGroupNameSlice) DeepCopySelector() labels.Selector
- func (p PodGroupNameSlice) Empty() bool
- func (p PodGroupNameSlice) IsBelongTo(ancestor PodGroupNameSlice) bool
- func (p PodGroupNameSlice) IsEmpty() bool
- func (p PodGroupNameSlice) Matches(labels labels.Labels) bool
- func (p PodGroupNameSlice) PodGroupName() string
- func (p PodGroupNameSlice) Requirements() (labels.Requirements, bool)
- func (p PodGroupNameSlice) RequiresExactMatch(label string) (value string, found bool)
- func (p PodGroupNameSlice) String() string
- type Scheduler
- func (s *Scheduler) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (s *Scheduler) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool
- func (s *Scheduler) Name() string
- func (s *Scheduler) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)
- func (s *Scheduler) PostBind(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)
- func (s *Scheduler) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) (*framework.PostFilterResult, *framework.Status)
- func (s *Scheduler) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
- func (s *Scheduler) PreFilterExtensions() framework.PreFilterExtensions
- func (s *Scheduler) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
- func (s *Scheduler) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (s *Scheduler) ScoreExtensions() framework.ScoreExtensions
- func (s *Scheduler) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
Constants ¶
const (
Name = "naglfar-scheduler"
)
Name is the name of naglfar scheduler
const (
// PodGroupLabel is the default label of naglfar scheduler
PodGroupLabel = "naglfar/podgroup"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Args ¶
type Args struct { // KubeConfig is the kubeconfig file path KubeConfig string `yaml:"kubeconfig" json:"kubeconfig"` // ScheduleTimeout is the wait duration in scheduling ScheduleTimeout util.Duration `yaml:"scheduleTimeout" json:"scheduleTimeout"` // RescheduleDelayOffset is the shift of the next reschedule time since now RescheduleDelayOffset util.Duration `yaml:"rescheduleDelayOffset" json:"rescheduleDelayOffset"` }
Args is the arguements for initializing scheduler
type PodGroupManager ¶
type PodGroupManager struct {
// contains filtered or unexported fields
}
PodGroupManager is the mananger of podgroup
func NewPodGroupManager ¶
func NewPodGroupManager(snapshotSharedLister framework.SharedLister, scheduleTimeout time.Duration, podInformer informerv1.PodInformer, kubeClientSet clientset.Interface, schedulingClient *client.SchedulingClient) *PodGroupManager
NewPodGroupManager is the constructor of PodGroupManager
type PodGroupNameSlice ¶
type PodGroupNameSlice []string
PodGroupNameSlice is type alias of []string
func ParsePodGroupNameSliceFromStr ¶
func ParsePodGroupNameSliceFromStr(pgName string) PodGroupNameSlice
ParsePodGroupNameSliceFromStr parses podGroupNameSlice from raw string
func (PodGroupNameSlice) Add ¶
func (p PodGroupNameSlice) Add(r ...labels.Requirement) labels.Selector
Add adds requirements to the Selector
func (PodGroupNameSlice) DeepCopySelector ¶
func (p PodGroupNameSlice) DeepCopySelector() labels.Selector
Make a deep copy of the selector.
func (PodGroupNameSlice) Empty ¶
func (p PodGroupNameSlice) Empty() bool
Empty returns true if this selector does not restrict the selection space.
func (PodGroupNameSlice) IsBelongTo ¶
func (p PodGroupNameSlice) IsBelongTo(ancestor PodGroupNameSlice) bool
IsUpperPodGroupOf checks whether this belongs to ancestor
func (PodGroupNameSlice) IsEmpty ¶
func (p PodGroupNameSlice) IsEmpty() bool
func (PodGroupNameSlice) Matches ¶
func (p PodGroupNameSlice) Matches(labels labels.Labels) bool
Matches returns true if this selector matches the given set of labels.
func (PodGroupNameSlice) PodGroupName ¶
func (p PodGroupNameSlice) PodGroupName() string
func (PodGroupNameSlice) Requirements ¶
func (p PodGroupNameSlice) Requirements() (labels.Requirements, bool)
Requirements converts this interface into Requirements to expose more detailed selection information. If there are querying parameters, it will return converted requirements and selectable=true. If this selector doesn't want to select anything, it will return selectable=false.
func (PodGroupNameSlice) RequiresExactMatch ¶
func (p PodGroupNameSlice) RequiresExactMatch(label string) (value string, found bool)
RequiresExactMatch allows a caller to introspect whether a given selector requires a single specific label to be set, and if so returns the value it requires.
func (PodGroupNameSlice) String ¶
func (p PodGroupNameSlice) String() string
String returns a human readable string that represents this selector.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is the custom scheduler of naglfar system
func (*Scheduler) Filter ¶
func (s *Scheduler) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter is called by the scheduling framework. All FilterPlugins should return "Success" to declare that the given node fits the pod. If Filter doesn't return "Success", it will return "Unschedulable", "UnschedulableAndUnresolvable" or "Error". For the node being evaluated, Filter plugins should look at the passed nodeInfo reference for this particular node's information (e.g., pods considered to be running on the node) instead of looking it up in the NodeInfoSnapshot because we don't guarantee that they will be the same. For example, during preemption, we may pass a copy of the original nodeInfo object that has some pods removed from it to evaluate the possibility of preempting them to schedule the target pod.
func (*Scheduler) Less ¶
func (s *Scheduler) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool
Less are used to sort pods in the scheduling queue.
func (*Scheduler) Permit ¶
func (s *Scheduler) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)
Permit is the functions invoked by the framework at "Permit" extension point.
func (*Scheduler) PostBind ¶
func (s *Scheduler) PostBind(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)
PostBind is called after a pod is successfully bound. These plugins are used update PodGroup when pod is bound.
func (*Scheduler) PostFilter ¶
func (s *Scheduler) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, filteredNodeStatusMap framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)
PostFilter is called by the scheduling framework. A PostFilter plugin should return one of the following statuses: - Unschedulable: the plugin gets executed successfully but the pod cannot be made schedulable. - Success: the plugin gets executed successfully and the pod can be made schedulable. - Error: the plugin aborts due to some internal error.
Informational plugins should be configured ahead of other ones, and always return Unschedulable status. Optionally, a non-nil PostFilterResult may be returned along with a Success status. For example, a preemption plugin may choose to return nominatedNodeName, so that framework can reuse that to update the preemptor pod's .spec.status.nominatedNodeName field.
Is used to rejecting a group of pods if a pod does not pass PreFilter or Filter.
func (*Scheduler) PreFilter ¶
func (s *Scheduler) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter is called at the beginning of the scheduling cycle. All PreFilter plugins must return success or the pod will be rejected.
func (*Scheduler) PreFilterExtensions ¶
func (s *Scheduler) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns a PreFilterExtensions interface if the plugin implements one, or nil if it does not. A Pre-filter plugin can provide extensions to incrementally modify its pre-processed info. The framework guarantees that the extensions AddPod/RemovePod will only be called after PreFilter, possibly on a cloned CycleState, and may call those functions more than once before calling Filter again on a specific node.
func (*Scheduler) Reserve ¶
func (s *Scheduler) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
Reserve is the functions invoked by the framework at "reserve" extension point.
func (*Scheduler) Score ¶
func (s *Scheduler) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score is called on each filtered node. It must return success and an integer indicating the rank of the node. All scoring plugins must return success or the pod will be rejected.
func (*Scheduler) ScoreExtensions ¶
func (s *Scheduler) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions returns a ScoreExtensions interface if it implements one, or nil if does not.