Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PolicyName is the symbol used to pull us in as a builtin policy. PolicyName = "static-plus" // PolicyDescription is a short description of this policy. PolicyDescription = "A simple policy supporting exclusive/pinned and shared allocations." )
View Source
const ( MilliCPUToCPU = 1000 // 100000 is equivalent to 100ms QuotaPeriod = 100000 MinQuotaPeriod = 1000 )
Functions for calculating CFS cpu.shares and cpu.cfs_quota_us.
Notes: These functions are almost verbatim taken from the kubelet code (from k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go). Since these are exported there, we could try to import them, set the related feature gates (kubefeatures.CPUCFSQuotaPeriod) for ourselves into the desired positions (disabled most probably for now) and use the imported code.
Variables ¶
This section is empty.
Functions ¶
func CreateStaticPlusPolicy ¶
func CreateStaticPlusPolicy(opts *policy.BackendOptions) policy.Backend
CreateStaticPlusPolicy creates a new policy instance.
func MilliCPUToQuota ¶
MilliCPUToQuota converts milliCPU to CFS quota and period values.
func MilliCPUToShares ¶
MilliCPUToShares converts the milliCPU to CFS shares.
Types ¶
type Allocations ¶
type Allocations map[string]*Assignment
Allocations track all resources allocations by the static+ policy.
type Assignment ¶
type Assignment struct {
// contains filtered or unexported fields
}
Assignment tracks resource assignments for a single container.
type CachedAllocations ¶
CachedAllocations implements Cache.Cachable boilerplate for Allocations.
Click to show internal directories.
Click to hide internal directories.