elasticquota

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name                              = "ElasticQuota"
	MigrateDefaultQuotaGroupsPodCycle = 1 * time.Second
)
View Source
const (
	ControllerName = "ElasticQuotaController"
)
View Source
const (
	QuotaOverUsedRevokeControllerName = "QuotaOverUsedRevokeController"
)

Variables

View Source
var (
	ElasticQuotaSpecMetric = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem: schedulermetrics.SchedulerSubsystem,
			Name:      "elastic_quota_spec",
			Help:      "ElasticQuota specifications",
		},
		[]string{"name", "resource", "tree", "is_parent", "parent", "field"},
	)

	ElasticQuotaStatusMetric = metrics.NewGaugeVec(
		&metrics.GaugeOpts{
			Subsystem: schedulermetrics.SchedulerSubsystem,
			Name:      "elastic_quota_status",
			Help:      "ElasticQuota current status",
		},
		[]string{"name", "resource", "tree", "is_parent", "parent", "field"},
	)

	UpdateElasticQuotaStatusLatency = metrics.NewHistogram(
		&metrics.HistogramOpts{
			Subsystem: schedulermetrics.SchedulerSubsystem,
			Name:      "update_elastic_quota_status_duration_seconds",
			Help:      "Update ElasticQuota status latency in seconds",
			Buckets:   metrics.ExponentialBuckets(0.001, 2, 15),
		},
	)
)

Functions

func EvictPod

func EvictPod(ctx context.Context, client clientset.Interface, pod *v1.Pod, deleteOptions *metav1.DeleteOptions) error

func New

func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error)

func RecordElasticQuotaMetric added in v1.4.1

func RecordElasticQuotaMetric(gaugeVec *metrics.GaugeVec, resources corev1.ResourceList, field string, labels map[string]string)

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is a controller that update elastic quota crd

func NewElasticQuotaController

func NewElasticQuotaController(plugin *Plugin) *Controller

func (*Controller) Name added in v1.0.0

func (ctrl *Controller) Name() string

func (*Controller) Start

func (ctrl *Controller) Start()

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) AddPod

func (g *Plugin) AddPod(ctx context.Context, state *framework.CycleState, podToSchedule *corev1.Pod, podInfoToAdd *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

AddPod is called by the framework while trying to evaluate the impact of adding podToAdd to the node while scheduling podToSchedule.

func (*Plugin) CandidatesToVictimsMap added in v1.3.0

func (g *Plugin) CandidatesToVictimsMap(candidates []preemption.Candidate) map[string]*extenderv1.Victims

func (*Plugin) EventsToRegister added in v1.4.0

func (g *Plugin) EventsToRegister() []framework.ClusterEvent

func (*Plugin) GetGroupQuotaManagerForQuota added in v1.4.0

func (g *Plugin) GetGroupQuotaManagerForQuota(quotaName string) *core.GroupQuotaManager

func (*Plugin) GetGroupQuotaManagerForTree added in v1.4.0

func (g *Plugin) GetGroupQuotaManagerForTree(treeID string) *core.GroupQuotaManager

func (*Plugin) GetOffsetAndNumCandidates added in v1.3.0

func (g *Plugin) GetOffsetAndNumCandidates(nodes int32) (int32, int32)

func (*Plugin) GetOrCreateGroupQuotaManagerForTree added in v1.4.0

func (g *Plugin) GetOrCreateGroupQuotaManagerForTree(treeID string) *core.GroupQuotaManager

func (*Plugin) GetQuotaName added in v1.4.0

func (g *Plugin) GetQuotaName(pod *v1.Pod) string

func (*Plugin) GetQuotaSummaries added in v1.0.0

func (g *Plugin) GetQuotaSummaries(tree string, includePods bool) map[string]*core.QuotaInfoSummary

func (*Plugin) GetQuotaSummary

func (g *Plugin) GetQuotaSummary(quotaName string, includePods bool) (*core.QuotaInfoSummary, bool)

func (*Plugin) ListGroupQuotaManagersForQuotaTree added in v1.4.0

func (g *Plugin) ListGroupQuotaManagersForQuotaTree() []*core.GroupQuotaManager

func (*Plugin) Name

func (g *Plugin) Name() string

func (*Plugin) NewControllers added in v1.0.0

func (g *Plugin) NewControllers() ([]frameworkext.Controller, error)

func (*Plugin) OnNodeAdd

func (g *Plugin) OnNodeAdd(obj interface{})

func (*Plugin) OnNodeDelete

func (g *Plugin) OnNodeDelete(obj interface{})

func (*Plugin) OnNodeUpdate

func (g *Plugin) OnNodeUpdate(oldObj, newObj interface{})

func (*Plugin) OnPodAdd

func (g *Plugin) OnPodAdd(obj interface{})

func (*Plugin) OnPodDelete

func (g *Plugin) OnPodDelete(obj interface{})

func (*Plugin) OnPodUpdate

func (g *Plugin) OnPodUpdate(oldObj, newObj interface{})

func (*Plugin) OnQuotaAdd

func (g *Plugin) OnQuotaAdd(obj interface{})

func (*Plugin) OnQuotaDelete

func (g *Plugin) OnQuotaDelete(obj interface{})

OnQuotaDelete if a quotaGroup is deleted, the pods should migrate to defaultQuotaGroup.

func (*Plugin) OnQuotaUpdate

func (g *Plugin) OnQuotaUpdate(oldObj, newObj interface{})

func (*Plugin) PodEligibleToPreemptOthers added in v1.3.0

func (g *Plugin) PodEligibleToPreemptOthers(pod *corev1.Pod, nominatedNodeStatus *framework.Status) (bool, string)

PodEligibleToPreemptOthers determines whether this pod should be considered for preempting other pods or not. If this pod has already preempted other pods and those are in their graceful termination period, it shouldn't be considered for preemption. We look at the node that is nominated for this pod and as long as there are terminating pods on the node, we don't consider this for preempting more pods.

func (*Plugin) PostFilter

func (g *Plugin) PostFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, filteredNodeStatusMap framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)

PostFilter modify the defaultPreemption, only allow pods in the same quota can preempt others.

func (*Plugin) PreFilter

func (g *Plugin) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)

func (*Plugin) PreFilterExtensions

func (g *Plugin) PreFilterExtensions() framework.PreFilterExtensions

func (*Plugin) RegisterEndpoints

func (g *Plugin) RegisterEndpoints(group *gin.RouterGroup)

func (*Plugin) RemovePod

func (g *Plugin) RemovePod(ctx context.Context, state *framework.CycleState, podToSchedule *corev1.Pod, podInfoToRemove *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

RemovePod is called by the framework while trying to evaluate the impact of removing podToRemove from the node while scheduling podToSchedule.

func (*Plugin) Reserve

func (g *Plugin) Reserve(ctx context.Context, state *framework.CycleState, p *corev1.Pod, nodeName string) *framework.Status

func (*Plugin) SelectVictimsOnNode added in v1.3.0

func (g *Plugin) SelectVictimsOnNode(
	ctx context.Context,
	state *framework.CycleState,
	pod *corev1.Pod,
	nodeInfo *framework.NodeInfo,
	pdbs []*policy.PodDisruptionBudget,
) ([]*corev1.Pod, int, *framework.Status)

SelectVictimsOnNode finds minimum set of pods on the given node that should be preempted in order to make enough room for "pod" to be scheduled. The minimum set selected is subject to the constraint that a higher-priority pod is never preempted when a lower-priority pod could be (higher/lower relative to one another, not relative to the preemptor "pod"). The algorithm first checks if the pod can be scheduled on the node when all the lower priority pods are gone. If so, it sorts all the lower priority pods by their priority and then puts them into two groups of those whose PodDisruptionBudget will be violated if preempted and other non-violating pods. Both groups are sorted by priority. It first tries to reprieve as many PDB violating pods as possible and then does them same for non-PDB-violating pods while checking that the "pod" can still fit on the node. NOTE: This function assumes that it is never called if "pod" cannot be scheduled due to pod affinity, node affinity, or node anti-affinity reasons. None of these predicates can be satisfied by removing more pods from the node.

func (*Plugin) Start

func (g *Plugin) Start()

func (*Plugin) Unreserve

func (g *Plugin) Unreserve(ctx context.Context, state *framework.CycleState, p *corev1.Pod, nodeName string)

type PostFilterState

type PostFilterState struct {
	// contains filtered or unexported fields
}

func (*PostFilterState) Clone

func (p *PostFilterState) Clone() framework.StateData

type QuotaOverUsedGroupMonitor

type QuotaOverUsedGroupMonitor struct {
	// contains filtered or unexported fields
}

func NewQuotaOverUsedGroupMonitor

func NewQuotaOverUsedGroupMonitor(quotaName string, manager *core.GroupQuotaManager, overUsedTriggerEvictDuration time.Duration) *QuotaOverUsedGroupMonitor

type QuotaOverUsedRevokeController

type QuotaOverUsedRevokeController struct {
	// contains filtered or unexported fields
}

func NewQuotaOverUsedRevokeController

func NewQuotaOverUsedRevokeController(plugin *Plugin) *QuotaOverUsedRevokeController

func (*QuotaOverUsedRevokeController) Name added in v1.0.0

func (controller *QuotaOverUsedRevokeController) Name() string

func (*QuotaOverUsedRevokeController) Start

func (controller *QuotaOverUsedRevokeController) Start()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL