Documentation ¶
Index ¶
- func PersistentVolumeClaimValidateLimitFunc(limitRange *api.LimitRange, pvc *api.PersistentVolumeClaim) error
- func PodMutateLimitFunc(limitRange *api.LimitRange, pod *api.Pod) error
- func PodValidateLimitFunc(limitRange *api.LimitRange, pod *api.Pod) error
- func Register(plugins *admission.Plugins)
- type DefaultLimitRangerActions
- func (d *DefaultLimitRangerActions) MutateLimit(limitRange *api.LimitRange, resourceName string, obj runtime.Object) error
- func (d *DefaultLimitRangerActions) SupportsAttributes(a admission.Attributes) bool
- func (d *DefaultLimitRangerActions) SupportsLimit(limitRange *api.LimitRange) bool
- func (d *DefaultLimitRangerActions) ValidateLimit(limitRange *api.LimitRange, resourceName string, obj runtime.Object) error
- type LimitRanger
- func (l *LimitRanger) Admit(a admission.Attributes) (err error)
- func (l *LimitRanger) GetLimitRanges(a admission.Attributes) ([]*api.LimitRange, error)
- func (a *LimitRanger) SetInternalKubeClientSet(client internalclientset.Interface)
- func (l *LimitRanger) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)
- func (l *LimitRanger) Validate(a admission.Attributes) (err error)
- func (l *LimitRanger) ValidateInitialization() error
- type LimitRangerActions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PersistentVolumeClaimValidateLimitFunc ¶ added in v1.9.1
func PersistentVolumeClaimValidateLimitFunc(limitRange *api.LimitRange, pvc *api.PersistentVolumeClaim) error
PersistentVolumeClaimValidateLimitFunc enforces storage limits for PVCs. Users request storage via pvc.Spec.Resources.Requests. Min/Max is enforced by an admin with LimitRange. Claims will not be modified with default values because storage is a required part of pvc.Spec. All storage enforced values *only* apply to pvc.Spec.Resources.Requests.
func PodMutateLimitFunc ¶ added in v1.9.1
func PodMutateLimitFunc(limitRange *api.LimitRange, pod *api.Pod) error
PodMutateLimitFunc sets resource requirements enumerated by the pod against the specified LimitRange. The pod may be modified to apply default resource requirements if not specified, and enumerated on the LimitRange
func PodValidateLimitFunc ¶ added in v1.9.1
func PodValidateLimitFunc(limitRange *api.LimitRange, pod *api.Pod) error
PodValidateLimitFunc enforces resource requirements enumerated by the pod against the specified LimitRange.
Types ¶
type DefaultLimitRangerActions ¶ added in v1.3.0
type DefaultLimitRangerActions struct{}
DefaultLimitRangerActions is the default implementation of LimitRangerActions.
func (*DefaultLimitRangerActions) MutateLimit ¶ added in v1.9.1
func (d *DefaultLimitRangerActions) MutateLimit(limitRange *api.LimitRange, resourceName string, obj runtime.Object) error
Limit enforces resource requirements of incoming resources against enumerated constraints on the LimitRange. It may modify the incoming object to apply default resource requirements if not specified, and enumerated on the LimitRange
func (*DefaultLimitRangerActions) SupportsAttributes ¶ added in v1.3.0
func (d *DefaultLimitRangerActions) SupportsAttributes(a admission.Attributes) bool
SupportsAttributes ignores all calls that do not deal with pod resources or storage requests (PVCs). Also ignores any call that has a subresource defined.
func (*DefaultLimitRangerActions) SupportsLimit ¶ added in v1.3.0
func (d *DefaultLimitRangerActions) SupportsLimit(limitRange *api.LimitRange) bool
SupportsLimit always returns true.
func (*DefaultLimitRangerActions) ValidateLimit ¶ added in v1.9.1
func (d *DefaultLimitRangerActions) ValidateLimit(limitRange *api.LimitRange, resourceName string, obj runtime.Object) error
Limit enforces resource requirements of incoming resources against enumerated constraints on the LimitRange. It may modify the incoming object to apply default resource requirements if not specified, and enumerated on the LimitRange
type LimitRanger ¶ added in v1.9.1
LimitRanger enforces usage limits on a per resource basis in the namespace
func NewLimitRanger ¶
func NewLimitRanger(actions LimitRangerActions) (*LimitRanger, error)
NewLimitRanger returns an object that enforces limits based on the supplied limit function
func (*LimitRanger) Admit ¶ added in v1.9.1
func (l *LimitRanger) Admit(a admission.Attributes) (err error)
Admit admits resources into cluster that do not violate any defined LimitRange in the namespace
func (*LimitRanger) GetLimitRanges ¶ added in v1.9.1
func (l *LimitRanger) GetLimitRanges(a admission.Attributes) ([]*api.LimitRange, error)
func (*LimitRanger) SetInternalKubeClientSet ¶ added in v1.9.1
func (a *LimitRanger) SetInternalKubeClientSet(client internalclientset.Interface)
func (*LimitRanger) SetInternalKubeInformerFactory ¶ added in v1.9.1
func (l *LimitRanger) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)
func (*LimitRanger) Validate ¶ added in v1.9.1
func (l *LimitRanger) Validate(a admission.Attributes) (err error)
Validate admits resources into cluster that do not violate any defined LimitRange in the namespace
func (*LimitRanger) ValidateInitialization ¶ added in v1.9.1
func (l *LimitRanger) ValidateInitialization() error
type LimitRangerActions ¶ added in v1.3.0
type LimitRangerActions interface { // MutateLimit is a pluggable function to set limits on the object. MutateLimit(limitRange *api.LimitRange, kind string, obj runtime.Object) error // ValidateLimits is a pluggable function to enforce limits on the object. ValidateLimit(limitRange *api.LimitRange, kind string, obj runtime.Object) error // SupportsAttributes is a pluggable function to allow overridding what resources the limitranger // supports. SupportsAttributes(attr admission.Attributes) bool // SupportsLimit is a pluggable function to allow ignoring limits that should not be applied // for any reason. SupportsLimit(limitRange *api.LimitRange) bool }