Documentation ¶
Index ¶
- Constants
- func New(_ runtime.Object, handle framework.Handle) (framework.Plugin, error)
- func QueueUnitToKey(qu *framework.QueueUnitInfo) string
- func SelectResourceQuota(rqs []*corev1.ResourceQuota, ns string) (*corev1.ResourceQuota, error)
- type ResourceQuota
- func (rq *ResourceQuota) Filter(ctx context.Context, qu *framework.QueueUnitInfo) *framework.Status
- func (rq *ResourceQuota) GetReservedByResourceName(ns string, rName corev1.ResourceName) resource.Quantity
- func (rq *ResourceQuota) Name() string
- func (rq *ResourceQuota) Reserve(ctx context.Context, qu *framework.QueueUnitInfo) *framework.Status
- func (rq *ResourceQuota) Unreserve(ctx context.Context, qu *framework.QueueUnitInfo)
Constants ¶
View Source
const ( ErrNoResourceQuotaTemplate = "found %d resources quota in ns: %s, expecting more than 0" ErrNoProperResourceQuotaFoundTemplate = "cannot find proper resource quota in namespace %s" ErrResourceQuotaStatusHardNilTemplate = "cannot find hard limit in the status of resource quota %s" ErrResourceQuotaTypeNotFoundTemplate = "resource type %s not found in resource quota %s" ErrResourceQuotaInsufficientTemplate = "insufficient resource left for %s in resource quota %s reserved %v/%v, request %v" ErrQueueUnitAlreadyReservedTemplate = "queue unit %s already reserved" )
View Source
const Name = "ResourceQuota"
Name is the name of the plugin used in the plugin registry and configurations.
Variables ¶
This section is empty.
Functions ¶
func QueueUnitToKey ¶
func QueueUnitToKey(qu *framework.QueueUnitInfo) string
func SelectResourceQuota ¶
func SelectResourceQuota(rqs []*corev1.ResourceQuota, ns string) (*corev1.ResourceQuota, error)
SelectResourceQuota returns the proper resource quota for the given namespace
Types ¶
type ResourceQuota ¶
ResourceQuota is a plugin that implements ResourceQuota filter.
func (*ResourceQuota) Filter ¶
func (rq *ResourceQuota) Filter(ctx context.Context, qu *framework.QueueUnitInfo) *framework.Status
Filter returns Status with success if there are enough resource left for the given QueueUnitInfo
func (*ResourceQuota) GetReservedByResourceName ¶
func (rq *ResourceQuota) GetReservedByResourceName(ns string, rName corev1.ResourceName) resource.Quantity
GetReservedByResourceName returns reserved resource quantity if the ResourceName is found, otherwise returns zero Quantity
func (*ResourceQuota) Name ¶
func (rq *ResourceQuota) Name() string
Name returns name of the plugin.
func (*ResourceQuota) Reserve ¶
func (rq *ResourceQuota) Reserve(ctx context.Context, qu *framework.QueueUnitInfo) *framework.Status
Reserve resource for the given QueueUnitInfo
func (*ResourceQuota) Unreserve ¶
func (rq *ResourceQuota) Unreserve(ctx context.Context, qu *framework.QueueUnitInfo)
Unreserve resource for the given QueueUnitInfo
Click to show internal directories.
Click to hide internal directories.