Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PolicyName is the name used to activate this policy. PolicyName = "podpools" // PolicyDescription is a short description of this policy. PolicyDescription = "Pod-granularity workload placement" // PolicyPath is the path of this policy in the configuration hierarchy. PolicyPath = "policy." + PolicyName )
Variables ¶
This section is empty.
Functions ¶
func CreatePodpoolsPolicy ¶
func CreatePodpoolsPolicy(policyOptions *policy.BackendOptions) policy.Backend
CreatePodpoolsPolicy creates a new policy instance.
Types ¶
type FillOrder ¶
type FillOrder int
FillOrder specifies the order in which pool instances should be filled.
func (FillOrder) MarshalJSON ¶
MarshalJSON marshals a FillOrder as a quoted json string
func (*FillOrder) UnmarshalJSON ¶
UnmarshalJSON unmarshals a FillOrder quoted json string to the enum value
type Metrics ¶ added in v0.7.0
type Metrics struct {
PoolMetrics map[string]*PoolMetrics
}
Metrics defines the podpools-specific metrics from policy level.
type PodpoolsOptions ¶
type PodpoolsOptions struct { // PinCPU controls pinning containers to CPUs. PinCPU bool `json:"PinCPU,omitempty"` // PinMemory controls pinning containers to memory nodes. PinMemory bool `json:"PinMemory,omitempty"` // PoolDefs contains pool definitions PoolDefs []*PoolDef `json:"Pools,omitempty"` }
PodpoolsOptions contains configuration options specific to this policy.
type Pool ¶
type Pool struct { // Def is the definition from which this pool instance is created. Def *PoolDef // Instance is the index of this pool instance, starting from // zero for every pool definition. Instance int // CPUs is the set of CPUs exclusive to this pool instance 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 pool. // - len(PodIDs[podID]) is the number of containers of podID // currently assigned to the pool. // - Def.MaxPods - len(PodIDs) is free pod capacity. PodIDs map[string][]string }
Pool contains attributes of a pool instance
func (Pool) PrettyName ¶
PrettyName returns unique name for a pool.
type PoolDef ¶
type PoolDef struct { // Name is the name of the pool, or name prefix of // multi-instance pools. Name string `json:"Name"` // CPU specifies the number of CPUs exclusively usable by // pods in the pool. CPU string `json:"CPU"` // MaxPods specifies the maximum number of pods assigned to // the pool. 0 (the default) means unlimited. -1 means no // pods. MaxPods int `json:"MaxPods"` // Instances specifies the number of multi-instance pools, // either directly or as CPU (count/percentage) reserved for // instances. The default is 1. Instances string `json:"Instances,omitempty"` // FillOrder specifies how multi-instance pools are filled. FillOrder FillOrder `json:"FillOrder"` }
PoolDef contains a pool definition.
Click to show internal directories.
Click to hide internal directories.