Documentation ¶
Index ¶
- Constants
- func FindCandidates(ctx context.Context, cs kubernetes.Interface, state *framework.CycleState, ...) ([]defaultpreemption.Candidate, error)
- func New(obj runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error)
- type CapacityScheduling
- func (c *CapacityScheduling) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, ...) *framework.Status
- func (c *CapacityScheduling) Name() string
- func (c *CapacityScheduling) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) (*framework.PostFilterResult, *framework.Status)
- func (c *CapacityScheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
- func (c *CapacityScheduling) PreFilterExtensions() framework.PreFilterExtensions
- func (c *CapacityScheduling) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, ...) *framework.Status
- func (c *CapacityScheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
- func (c *CapacityScheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
- type ElasticQuotaInfo
- type ElasticQuotaInfos
- type ElasticQuotaSnapshotState
- type PreFilterState
Constants ¶
const ( // Name is the name of the plugin used in Registry and configurations. Name = "CapacityScheduling" ElasticQuotaSnapshotKey = "ElasticQuotaSnapshot" )
Variables ¶
This section is empty.
Functions ¶
func FindCandidates ¶
func FindCandidates(ctx context.Context, cs kubernetes.Interface, state *framework.CycleState, pod *v1.Pod, m framework.NodeToStatusMap, ph framework.PreemptHandle, nodeLister framework.NodeInfoLister, pdbLister policylisters.PodDisruptionBudgetLister) ([]defaultpreemption.Candidate, error)
FindCandidates calculates a slice of preemption candidates. Each candidate is executable to make the given <pod> schedulable.
Types ¶
type CapacityScheduling ¶
CapacityScheduling is a plugin that implements the mechanism of capacity scheduling.
func (*CapacityScheduling) AddPod ¶
func (c *CapacityScheduling) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
AddPod from pre-computed data in cycleState.
func (*CapacityScheduling) Name ¶
func (c *CapacityScheduling) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*CapacityScheduling) PostFilter ¶
func (c *CapacityScheduling) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, filteredNodeStatusMap framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)
func (*CapacityScheduling) PreFilter ¶
func (c *CapacityScheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter performs the following validations. 1. Check if the (pod.request + eq.allocated) is less than eq.max. 2. Check if the sum(eq's usage) > sum(eq's min).
func (*CapacityScheduling) PreFilterExtensions ¶
func (c *CapacityScheduling) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
func (*CapacityScheduling) RemovePod ¶
func (c *CapacityScheduling) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
RemovePod from pre-computed data in cycleState.
func (*CapacityScheduling) Reserve ¶
func (c *CapacityScheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
func (*CapacityScheduling) Unreserve ¶
func (c *CapacityScheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
type ElasticQuotaInfo ¶
type ElasticQuotaInfo struct { Namespace string Min *framework.Resource Max *framework.Resource Used *framework.Resource // contains filtered or unexported fields }
ElasticQuotaInfo is a wrapper to a ElasticQuota with information. Each namespace can only have one ElasticQuota.
type ElasticQuotaInfos ¶
type ElasticQuotaInfos map[string]*ElasticQuotaInfo
func NewElasticQuotaInfos ¶
func NewElasticQuotaInfos() ElasticQuotaInfos
type ElasticQuotaSnapshotState ¶
type ElasticQuotaSnapshotState struct {
// contains filtered or unexported fields
}
ElasticQuotaSnapshot stores the snapshot of elasticQuotas.
func (*ElasticQuotaSnapshotState) Clone ¶
func (s *ElasticQuotaSnapshotState) Clone() framework.StateData
Clone the ElasticQuotaSnapshot state.
type PreFilterState ¶
PreFilterState computed at PreFilter and used at PostFilter or Reserve.
func (*PreFilterState) Clone ¶
func (s *PreFilterState) Clone() framework.StateData
Clone the preFilter state.