limits

package
v0.0.0-...-61304a0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: LGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LimitsNotPresent    = "LimitSentry: pod rejected because of missing limits"
	LimitsOutsideMemory = "LimitSentry: pod rejected because some containers are outside the memory limits"
	LimitsOutsideCPU    = "LimitSentry: pod rejected because some containers are outside the cpu limits"
)
View Source
const (
	NAME = "limits"
)

Variables

This section is empty.

Functions

func QtyHookFunc

func QtyHookFunc(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

Types

type Config

type Config struct {
	CPU    MinMax `mapstructure:"cpu"`
	Memory MinMax `mapstructure:"memory"`
}

func (*Config) LoadSentry

func (c *Config) LoadSentry() sentry.Sentry

func (*Config) Name

func (c *Config) Name() string

type LimitSentry

type LimitSentry struct {
	*Config
}

func (LimitSentry) Admit

func (ls LimitSentry) Admit(receivedAdmissionReview v1beta1.AdmissionReview) *v1beta1.AdmissionResponse

func (LimitSentry) BetweenCPU

func (ls LimitSentry) BetweenCPU(q resource.Quantity) bool

func (LimitSentry) BetweenMemory

func (ls LimitSentry) BetweenMemory(q resource.Quantity) bool

func (LimitSentry) Type

func (ls LimitSentry) Type() string

type MinMax

type MinMax struct {
	Min resource.Quantity `mapstructure:"min"`
	Max resource.Quantity `mapstructure:"max"`
}

Jump to

Keyboard shortcuts

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