Documentation
¶
Index ¶
Constants ¶
const ( // PolicyName is the name used to activate this policy. PolicyName = "dynamic-pools" // PolicyDescription is a short description of this policy. PolicyDescription = "The cpuset of the dynamic pools can be dynamically changed based on workload." // PolicyPath is the path of this policy in the configuration hierarchy. PolicyPath = "policy." + PolicyName )
Variables ¶
This section is empty.
Functions ¶
func CreateDynamicPoolsPolicy ¶
func CreateDynamicPoolsPolicy(policyOptions *policy.BackendOptions) policy.Backend
CreateDynamicPoolsPolicy creates a new policy instance.
Types ¶
type DynamicPool ¶
type DynamicPool struct { // Def is the definition from which this dynamicPool is created. Def *DynamicPoolDef // Cpus is the set of CPUs exclusive to this dynamicPool only. Cpus cpuset.CPUSet // Mems is the set of memory nodes with minimal access delay from CPUs. Mems idset.IDSet // PodIDs maps pod ID to list of container IDs. // - len(PodIDs) is the number of pods in the dynamicPool. // - len(PodIDs[podID]) is the number of containers of podID currently assigned to the dynamicPool. PodIDs map[string][]string }
DynamicPool contains attributes of a dynamicPool
func (DynamicPool) AvailMilliCpus ¶
func (dp DynamicPool) AvailMilliCpus() int
AvailMilliCpus returns the number of CPUs in a dynamicPool.
func (DynamicPool) ContainerCount ¶
func (dp DynamicPool) ContainerCount() int
ContainerCount returns the number of containers in a dynamicPool.
func (DynamicPool) ContainerIDs ¶
func (dp DynamicPool) ContainerIDs() []string
ContainerIDs returns IDs of containers assigned in a dynamicPool. (Using cache.Container.GetCacheID()'s)
func (DynamicPool) PrettyName ¶
func (dp DynamicPool) PrettyName() string
PrettyName returns a unique name for a dynamicPool.
func (DynamicPool) String ¶
func (dp DynamicPool) String() string
String is a stringer for a dynamicPool.
type DynamicPoolDef ¶
type DynamicPoolDef struct { // Name of the dynamicPool definition. Name string `json:"Name"` Namespaces []string `json:"Namespaces",omitempty` CpuClass string `json:"CpuClass"` // AllocatorPriority (0: High, 1: Normal, 2: Low, 3: None) // This parameter is passed to CPU allocator when creating or // resizing a dynamicPool. At init, dynamicPools with highest priority // CPUs are allocated first. AllocatorPriority cpuallocator.CPUPriority `json:"AllocatorPriority"` }
DynamicPoolDef contains a dynamicPool definition.
func (*DynamicPoolDef) DeepCopy ¶
func (bdef *DynamicPoolDef) DeepCopy() *DynamicPoolDef
DeepCopy creates a deep copy of a DynamicPoolDef
func (DynamicPoolDef) String ¶
func (dpDef DynamicPoolDef) String() string
String stringifies a DynamicPoolsDef
type DynamicPoolMetrics ¶
type DynamicPoolMetrics struct { // dynamicPool type metrics DefName string CpuClass string // DynamicPool instance metrics PrettyName string Cpus cpuset.CPUSet Mems string ContainerNames string ContainerReqMilliCpus int ContainerLimitMilliCpus int }
DynamicPoolMetrics define metrics of a dynamicPool instance.
type DynamicPoolsOptions ¶
type DynamicPoolsOptions dynamicPoolsOptionsWrapped
func (*DynamicPoolsOptions) DeepCopy ¶
func (dpo *DynamicPoolsOptions) DeepCopy() *DynamicPoolsOptions
DeepCopy creates a deep copy of a DynamicPoolsOptions
func (*DynamicPoolsOptions) UnmarshalJSON ¶
func (bo *DynamicPoolsOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON makes sure all options from previous unmarshals get cleared before unmarshaling new data to the same address.
type Metrics ¶
type Metrics struct {
DynamicPools []*DynamicPoolMetrics
}
Metrics defines the dynamicPools-specific metrics from policy level.