Documentation
¶
Overview ¶
resourcequota contains a controller that makes resource quota usage observations
Index ¶
- func IsUnhandledGroupKindError(err error) bool
- func NewUnhandledGroupKindError(kind unversioned.GroupKind) error
- func ObjectReplenishmentDeleteFunc(options *ReplenishmentControllerOptions) func(obj interface{})
- func PodReplenishmentUpdateFunc(options *ReplenishmentControllerOptions) func(oldObj, newObj interface{})
- func ServiceReplenishmentUpdateFunc(options *ReplenishmentControllerOptions) func(oldObj, newObj interface{})
- type ReplenishmentControllerFactory
- type ReplenishmentControllerOptions
- type ReplenishmentFunc
- type ResourceQuotaController
- type ResourceQuotaControllerOptions
- type UnionReplenishmentControllerFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnhandledGroupKindError ¶ added in v1.4.2
func NewUnhandledGroupKindError ¶ added in v1.4.2
func NewUnhandledGroupKindError(kind unversioned.GroupKind) error
func ObjectReplenishmentDeleteFunc ¶
func ObjectReplenishmentDeleteFunc(options *ReplenishmentControllerOptions) func(obj interface{})
ObjectReplenenishmentDeleteFunc will replenish on every delete
func PodReplenishmentUpdateFunc ¶
func PodReplenishmentUpdateFunc(options *ReplenishmentControllerOptions) func(oldObj, newObj interface{})
PodReplenishmentUpdateFunc will replenish if the old pod was quota tracked but the new is not
func ServiceReplenishmentUpdateFunc ¶ added in v1.3.0
func ServiceReplenishmentUpdateFunc(options *ReplenishmentControllerOptions) func(oldObj, newObj interface{})
ServiceReplenishmentUpdateFunc will replenish if the service was quota tracked has changed service type
Types ¶
type ReplenishmentControllerFactory ¶
type ReplenishmentControllerFactory interface { // NewController returns a controller configured with the specified options. // This method is NOT thread-safe. NewController(options *ReplenishmentControllerOptions) (cache.ControllerInterface, error) }
ReplenishmentControllerFactory knows how to build replenishment controllers
func NewReplenishmentControllerFactory ¶
func NewReplenishmentControllerFactory(podInformer cache.SharedInformer, kubeClient clientset.Interface) ReplenishmentControllerFactory
NewReplenishmentControllerFactory returns a factory that knows how to build controllers to replenish resources when updated or deleted
func NewReplenishmentControllerFactoryFromClient ¶ added in v1.3.0
func NewReplenishmentControllerFactoryFromClient(kubeClient clientset.Interface) ReplenishmentControllerFactory
type ReplenishmentControllerOptions ¶
type ReplenishmentControllerOptions struct { // The kind monitored for replenishment GroupKind unversioned.GroupKind // The period that should be used to re-sync the monitored resource ResyncPeriod controller.ResyncPeriodFunc // The function to invoke when a change is observed that should trigger // replenishment ReplenishmentFunc ReplenishmentFunc }
ReplenishmentControllerOptions is an options struct that tells a factory how to configure a controller that can inform the quota system it should replenish quota
type ReplenishmentFunc ¶
type ReplenishmentFunc func(groupKind unversioned.GroupKind, namespace string, object runtime.Object)
ReplenishmentFunc is a function that is invoked when controller sees a change that may require a quota to be replenished (i.e. object deletion, or object moved to terminal state)
type ResourceQuotaController ¶
type ResourceQuotaController struct {
// contains filtered or unexported fields
}
ResourceQuotaController is responsible for tracking quota usage status in the system
func NewResourceQuotaController ¶
func NewResourceQuotaController(options *ResourceQuotaControllerOptions) *ResourceQuotaController
func (*ResourceQuotaController) Run ¶
func (rq *ResourceQuotaController) Run(workers int, stopCh <-chan struct{})
Run begins quota controller using the specified number of workers
type ResourceQuotaControllerOptions ¶
type ResourceQuotaControllerOptions struct { // Must have authority to list all quotas, and update quota status KubeClient clientset.Interface // Controls full recalculation of quota usage ResyncPeriod controller.ResyncPeriodFunc // Knows how to calculate usage Registry quota.Registry // Knows how to build controllers that notify replenishment events ControllerFactory ReplenishmentControllerFactory // Controls full resync of objects monitored for replenihsment. ReplenishmentResyncPeriod controller.ResyncPeriodFunc // List of GroupKind objects that should be monitored for replenishment at // a faster frequency than the quota controller recalculation interval GroupKindsToReplenish []unversioned.GroupKind }
ResourceQuotaControllerOptions holds options for creating a quota controller
type UnionReplenishmentControllerFactory ¶ added in v1.4.2
type UnionReplenishmentControllerFactory []ReplenishmentControllerFactory
UnionReplenishmentControllerFactory iterates through its constituent factories ignoring, UnhandledGroupKindErrors returning the first success or failure it hits. If there are no hits either way, it return an UnhandledGroupKind error
func (UnionReplenishmentControllerFactory) NewController ¶ added in v1.4.2
func (f UnionReplenishmentControllerFactory) NewController(options *ReplenishmentControllerOptions) (cache.ControllerInterface, error)