Documentation ¶
Overview ¶
resourcequota enforces all incoming requests against any applied quota in the namespace context of the request
Index ¶
- Constants
- func CheckRequest(quotas []api.ResourceQuota, a admission.Attributes, evaluator quota.Evaluator, ...) ([]api.ResourceQuota, error)
- func IsDefaultDeny(err error) bool
- func LoadConfiguration(config io.Reader) (*resourcequotaapi.Configuration, error)
- func Register(plugins *admission.Plugins)
- type Evaluator
- type QuotaAccessor
- type QuotaAdmission
- func (a *QuotaAdmission) SetInternalKubeClientSet(client internalclientset.Interface)
- func (a *QuotaAdmission) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)
- func (a *QuotaAdmission) SetQuotaConfiguration(c quota.Configuration)
- func (a *QuotaAdmission) Validate(attr admission.Attributes) (err error)
- func (a *QuotaAdmission) ValidateInitialization() error
Constants ¶
const PluginName = "ResourceQuota"
Variables ¶
This section is empty.
Functions ¶
func CheckRequest ¶ added in v1.12.0
func CheckRequest(quotas []api.ResourceQuota, a admission.Attributes, evaluator quota.Evaluator, limited []resourcequotaapi.LimitedResource) ([]api.ResourceQuota, error)
CheckRequest is a static version of quotaEvaluator.checkRequest, possible to be called from outside.
func IsDefaultDeny ¶ added in v1.3.0
IsDefaultDeny returns true if the error is defaultDeny
func LoadConfiguration ¶ added in v1.6.0
func LoadConfiguration(config io.Reader) (*resourcequotaapi.Configuration, error)
LoadConfiguration loads the provided configuration.
Types ¶
type Evaluator ¶ added in v1.4.2
type Evaluator interface { // Evaluate takes an operation and checks to see if quota constraints are satisfied. It returns an error if they are not. // The default implementation process related operations in chunks when possible. Evaluate(a admission.Attributes) error }
Evaluator is used to see if quota constraints are satisfied.
func NewQuotaEvaluator ¶ added in v1.4.2
func NewQuotaEvaluator(quotaAccessor QuotaAccessor, ignoredResources map[schema.GroupResource]struct{}, quotaRegistry quota.Registry, lockAcquisitionFunc func([]api.ResourceQuota) func(), config *resourcequotaapi.Configuration, workers int, stopCh <-chan struct{}) Evaluator
NewQuotaEvaluator configures an admission controller that can enforce quota constraints using the provided registry. The registry must have the capability to handle group/kinds that are persisted by the server this admission controller is intercepting
type QuotaAccessor ¶ added in v1.4.2
type QuotaAccessor interface { // UpdateQuotaStatus is called to persist final status. This method should write to persistent storage. // An error indicates that write didn't complete successfully. UpdateQuotaStatus(newQuota *api.ResourceQuota) error // GetQuotas gets all possible quotas for a given namespace GetQuotas(namespace string) ([]api.ResourceQuota, error) }
QuotaAccessor abstracts the get/set logic from the rest of the Evaluator. This could be a test stub, a straight passthrough, or most commonly a series of deconflicting caches.
type QuotaAdmission ¶ added in v1.9.1
QuotaAdmission implements an admission controller that can enforce quota constraints
func NewResourceQuota ¶
func NewResourceQuota(config *resourcequotaapi.Configuration, numEvaluators int, stopCh <-chan struct{}) (*QuotaAdmission, error)
NewResourceQuota configures an admission controller that can enforce quota constraints using the provided registry. The registry must have the capability to handle group/kinds that are persisted by the server this admission controller is intercepting
func (*QuotaAdmission) SetInternalKubeClientSet ¶ added in v1.9.1
func (a *QuotaAdmission) SetInternalKubeClientSet(client internalclientset.Interface)
func (*QuotaAdmission) SetInternalKubeInformerFactory ¶ added in v1.9.1
func (a *QuotaAdmission) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)
func (*QuotaAdmission) SetQuotaConfiguration ¶ added in v1.9.1
func (a *QuotaAdmission) SetQuotaConfiguration(c quota.Configuration)
func (*QuotaAdmission) Validate ¶ added in v1.9.1
func (a *QuotaAdmission) Validate(attr admission.Attributes) (err error)
Validate makes admission decisions while enforcing quota
func (*QuotaAdmission) ValidateInitialization ¶ added in v1.9.1
func (a *QuotaAdmission) ValidateInitialization() error
ValidateInitialization ensures an authorizer is set.
Directories ¶
Path | Synopsis |
---|---|
apis
|
|
resourcequota/install
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery.
|
Package install installs the experimental API group, making it available as an option to all of the API encoding/decoding machinery. |
resourcequota/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
|
Package v1alpha1 is the v1alpha1 version of the API. |
resourcequota/v1beta1
Package v1beta1 is the v1beta1 version of the API.
|
Package v1beta1 is the v1beta1 version of the API. |