elasticquota

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQuotaName added in v1.1.0

func GetQuotaName(pod *corev1.Pod, kubeClient client.Client) string

func MakeResourceList added in v1.6.0

func MakeResourceList() *resourceWrapper

func NewQuotaInformer added in v1.6.0

func NewQuotaInformer(cache cache.Cache, qt *quotaTopology) (cache.Informer, error)

func NewQuotaTopology

func NewQuotaTopology(client client.Client) *quotaTopology

Types

type PodWrapper added in v1.6.0

type PodWrapper struct{ *v1.Pod }

func MakePod added in v1.6.0

func MakePod(namespace, name string) *PodWrapper

func (*PodWrapper) Container added in v1.6.0

func (p *PodWrapper) Container(request v1.ResourceList) *PodWrapper

func (*PodWrapper) Label added in v1.6.0

func (p *PodWrapper) Label(string1, string2 string) *PodWrapper

func (*PodWrapper) Obj added in v1.6.0

func (p *PodWrapper) Obj() *v1.Pod

type QuotaCalculateInfo

type QuotaCalculateInfo struct {
	// The semantics of "max" is the quota group's upper limit of resources.
	Max v1.ResourceList
	// The semantics of "min" is the quota group's guaranteed resources, if quota group's "request" less than or
	// equal to "min", the quota group can obtain equivalent resources to the "request"
	Min v1.ResourceList

	Guaranteed v1.ResourceList
	Allocated  v1.ResourceList
}

type QuotaInfo

type QuotaInfo struct {
	IsParent          bool
	AllowLentResource bool
	AllowForceUpdate  bool
	Name              string
	ParentName        string
	TreeID            string
	IsTreeRoot        bool
	CalculateInfo     QuotaCalculateInfo
}

func NewQuotaInfo

func NewQuotaInfo(isParent, allowLentResource bool, name, parentName string) *QuotaInfo

func NewQuotaInfoFromQuota

func NewQuotaInfoFromQuota(quota *v1alpha1.ElasticQuota) *QuotaInfo

func (*QuotaInfo) GetQuotaSummary

func (qi *QuotaInfo) GetQuotaSummary() *QuotaInfoSummary

type QuotaInfoSummary

type QuotaInfoSummary struct {
	Name              string `json:"name"`
	ParentName        string `json:"parentName"`
	IsParent          bool   `json:"isParent"`
	AllowLentResource bool   `json:"allowLentResource"`

	Max v1.ResourceList `json:"max"`
	Min v1.ResourceList `json:"min"`
}

func NewQuotaInfoSummary

func NewQuotaInfoSummary() *QuotaInfoSummary

type QuotaMetaChecker

type QuotaMetaChecker struct {
	client.Client
	*admission.Decoder
	QuotaTopo     *quotaTopology
	QuotaInformer cache.Informer
}

func NewPlugin

func NewPlugin(decoder *admission.Decoder, client client.Client) *QuotaMetaChecker

func (*QuotaMetaChecker) AdmitQuota

func (c *QuotaMetaChecker) AdmitQuota(ctx context.Context, req admission.Request, obj runtime.Object) error

func (*QuotaMetaChecker) GetQuotaInfo added in v1.4.1

func (c *QuotaMetaChecker) GetQuotaInfo(name, namespace string) *QuotaInfo

func (*QuotaMetaChecker) GetQuotaTopologyInfo

func (c *QuotaMetaChecker) GetQuotaTopologyInfo() *QuotaTopologySummary

func (*QuotaMetaChecker) InjectInformer added in v1.6.0

func (c *QuotaMetaChecker) InjectInformer(elasticQuotaInformer cache.Informer)

func (*QuotaMetaChecker) Name added in v1.6.0

func (c *QuotaMetaChecker) Name() string

func (*QuotaMetaChecker) ValidatePod

func (c *QuotaMetaChecker) ValidatePod(ctx context.Context, req admission.Request) error

func (*QuotaMetaChecker) ValidateQuota

func (c *QuotaMetaChecker) ValidateQuota(ctx context.Context, req admission.Request, obj runtime.Object) error

type QuotaTopologySummary

type QuotaTopologySummary struct {
	QuotaInfoMap       map[string]*QuotaInfoSummary `json:"quotaInfoMap"`
	QuotaHierarchyInfo map[string][]string          `json:"quotaHierarchyInfo"`
}

func NewQuotaTopologySummary

func NewQuotaTopologySummary() *QuotaTopologySummary

type QuotaWrapper added in v1.6.0

type QuotaWrapper struct {
	*v1alpha1.ElasticQuota
}

func MakeQuota added in v1.6.0

func MakeQuota(name string) *QuotaWrapper

func (*QuotaWrapper) Admission added in v1.6.0

func (q *QuotaWrapper) Admission(request v1.ResourceList) *QuotaWrapper

func (*QuotaWrapper) Annotations added in v1.6.0

func (q *QuotaWrapper) Annotations(annotations map[string]string) *QuotaWrapper

func (*QuotaWrapper) ChildRequest added in v1.6.0

func (q *QuotaWrapper) ChildRequest(request v1.ResourceList) *QuotaWrapper

func (*QuotaWrapper) Guaranteed added in v1.6.0

func (q *QuotaWrapper) Guaranteed(guaranteed v1.ResourceList) *QuotaWrapper

func (*QuotaWrapper) IsParent added in v1.6.0

func (q *QuotaWrapper) IsParent(isParent bool) *QuotaWrapper

func (*QuotaWrapper) IsRoot added in v1.6.0

func (q *QuotaWrapper) IsRoot(isRoot bool) *QuotaWrapper

func (*QuotaWrapper) Max added in v1.6.0

func (*QuotaWrapper) Min added in v1.6.0

func (*QuotaWrapper) Namespace added in v1.6.0

func (q *QuotaWrapper) Namespace(ns string) *QuotaWrapper

func (*QuotaWrapper) Obj added in v1.6.0

func (*QuotaWrapper) ParentName added in v1.6.0

func (q *QuotaWrapper) ParentName(parentName string) *QuotaWrapper

func (*QuotaWrapper) TreeID added in v1.6.0

func (q *QuotaWrapper) TreeID(tree string) *QuotaWrapper

func (*QuotaWrapper) Used added in v1.6.0

func (q *QuotaWrapper) Used(used v1.ResourceList) *QuotaWrapper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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