kubernetesk8s.io/kubernetes/plugin/pkg/admission/resourcequota Index | Files

package resourcequota

import "k8s.io/kubernetes/plugin/pkg/admission/resourcequota"

resourcequota enforces all incoming requests against any applied quota in the namespace context of the request

Index

Functions

func IsDefaultDeny

func IsDefaultDeny(err error) bool

func NewResourceQuota

func NewResourceQuota(client clientset.Interface, registry quota.Registry, numEvaluators int, stopCh <-chan struct{}) (admission.Interface, 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

Types

type Evaluator

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

func NewQuotaEvaluator(quotaAccessor QuotaAccessor, registry quota.Registry, lockAquisitionFunc func([]api.ResourceQuota) func(), 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

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.

Source Files

admission.go controller.go doc.go resource_access.go

Version
v1.4.1
Published
Oct 10, 2016
Platform
linux/amd64
Imports
22 packages
Last checked
5 minutes ago

Tools for package owners.