limiters

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalLimiter

type GlobalLimiter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewGlobalLimiter

func NewGlobalLimiter(policy *konsumeratorv1.ResourcePolicy, used *corev1.ResourceList, log logr.Logger) *GlobalLimiter

func (*GlobalLimiter) ApplyLimits

ApplyLimits returns amount resources that is possible to allocate, if pool is exhasted returns zeros

func (*GlobalLimiter) MaxAllowed added in v0.9.5

func (l *GlobalLimiter) MaxAllowed(_ string) *corev1.ResourceList

func (*GlobalLimiter) MinAllowed added in v0.9.5

func (l *GlobalLimiter) MinAllowed(_ string) *corev1.ResourceList

nop

type InstanceLimiter

type InstanceLimiter struct {
	// contains filtered or unexported fields
}

func NewInstanceLimiter

func NewInstanceLimiter(policy *konsumeratorv1.ResourcePolicy, log logr.Logger) *InstanceLimiter

func (*InstanceLimiter) ApplyLimits

func (il *InstanceLimiter) ApplyLimits(containerName string, resources *corev1.ResourceRequirements) *corev1.ResourceRequirements

func (*InstanceLimiter) MaxAllowed added in v0.9.5

func (il *InstanceLimiter) MaxAllowed(containerName string) *corev1.ResourceList

func (*InstanceLimiter) MinAllowed added in v0.9.5

func (il *InstanceLimiter) MinAllowed(containerName string) *corev1.ResourceList

type ResourceLimiter

type ResourceLimiter interface {
	MinAllowed(containerName string) *corev1.ResourceList
	MaxAllowed(containerName string) *corev1.ResourceList
	ApplyLimits(containerName string, resources *corev1.ResourceRequirements) *corev1.ResourceRequirements
}

Jump to

Keyboard shortcuts

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