podpools

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

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.

const (
	FillBalanced FillOrder = iota
	FillPacked
	FillFirstFree
)

func (FillOrder) MarshalJSON

func (fo FillOrder) MarshalJSON() ([]byte, error)

MarshalJSON marshals a FillOrder as a quoted json string

func (FillOrder) String

func (fo FillOrder) String() string

String stringifies a FillOrder

func (*FillOrder) UnmarshalJSON

func (fo *FillOrder) UnmarshalJSON(b []byte) error

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

func (pool Pool) PrettyName() string

PrettyName returns unique name for a pool.

func (Pool) String

func (pool Pool) String() string

String is a stringer 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.

type PoolMetrics added in v0.7.0

type PoolMetrics struct {
	DefName        string
	PrettyName     string
	CPUs           cpuset.CPUSet
	CPUIds         []int
	MilliCPUs      string
	Memory         string
	ContainerNames string
	PodNames       string
}

PoolMetrics defines the podpools-specific metrics from pool level.

Jump to

Keyboard shortcuts

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