limits

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LimitsNotSet occurs when there are no cpu and memory limits specified for a container
	LimitsNotSet = "LimitsNotSet"
	// LimitsCPUNotSet occurs when there is no cpu limit specified for a container
	LimitsCPUNotSet = "LimitsCPUNotSet"
	// LimitsMemoryNotSet occurs when there is no memory limit specified for a container
	LimitsMemoryNotSet = "LimitsMemoryNotSet"
	// LimitsCPUExceeded occurs when the CPU limit specified for a container is higher than the specified max CPU limit
	LimitsCPUExceeded = "LimitsCPUExceeded"
	// LimitsMemoryExceeded occurs when the memory limit specified for a container is higher than the specified max memory limit
	LimitsMemoryExceeded = "LimitsMemoryExceeded"
)
View Source
const Name = "limits"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CPU    string `yaml:"cpu"`
	Memory string `yaml:"memory"`
}

func (*Config) GetCPU

func (config *Config) GetCPU() (k8sResource.Quantity, error)

func (*Config) GetMemory

func (config *Config) GetMemory() (k8sResource.Quantity, error)

type Limits

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

Limits implements Auditable

func New

func New(config Config) (*Limits, error)

func (*Limits) Audit

func (limits *Limits) Audit(resource k8s.Resource, _ []k8s.Resource) ([]*kubeaudit.AuditResult, error)

Audit checks that the container cpu and memory limits do not exceed specified limits

Jump to

Keyboard shortcuts

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