Documentation ¶
Index ¶
- Variables
- type CPUAnnotation
- func (cpuAnnotation CPUAnnotation) ContainerExclusiveCPU(container string) int
- func (cpuAnnotation CPUAnnotation) ContainerPools(cName string) (pools []string)
- func (cpuAnnotation CPUAnnotation) ContainerSharedCPUTime(container string) int
- func (cpuAnnotation CPUAnnotation) ContainerTotalCPURequest(pool string, cName string) int
- func (cpuAnnotation CPUAnnotation) Containers() []string
- func (cpuAnnotation *CPUAnnotation) Decode(annotation []byte) error
- type Container
- type Pool
- type PoolConfig
- type Process
Constants ¶
This section is empty.
Variables ¶
var PoolConfigDir = "/etc/cpu-pooler"
PoolConfigDir defines the pool configuration file location
Functions ¶
This section is empty.
Types ¶
type CPUAnnotation ¶
type CPUAnnotation []Container
CPUAnnotation defines the pod cpu annotation structure
func (CPUAnnotation) ContainerExclusiveCPU ¶
func (cpuAnnotation CPUAnnotation) ContainerExclusiveCPU(container string) int
ContainerExclusiveCPU returns sum of cpu time requested from exclusive pool by a container
func (CPUAnnotation) ContainerPools ¶
func (cpuAnnotation CPUAnnotation) ContainerPools(cName string) (pools []string)
ContainerPools returns all pools configured for container
func (CPUAnnotation) ContainerSharedCPUTime ¶
func (cpuAnnotation CPUAnnotation) ContainerSharedCPUTime(container string) int
ContainerSharedCPUTime returns sum of cpu time requested from shared pool by a container
func (CPUAnnotation) ContainerTotalCPURequest ¶
func (cpuAnnotation CPUAnnotation) ContainerTotalCPURequest(pool string, cName string) int
ContainerTotalCPURequest returns CPU requests of container from pool
func (CPUAnnotation) Containers ¶
func (cpuAnnotation CPUAnnotation) Containers() []string
Containers returns container name string in annotation
func (*CPUAnnotation) Decode ¶
func (cpuAnnotation *CPUAnnotation) Decode(annotation []byte) error
Decode unmarshals json annotation to CPUAnnotation
type PoolConfig ¶
type PoolConfig struct { Pools map[string]Pool `yaml:"pools"` NodeSelector map[string]string `yaml:"nodeSelector"` }
PoolConfig defines pool configuration for a node
func DeterminePoolConfig ¶
func DeterminePoolConfig() (PoolConfig, string, error)
DeterminePoolConfig first interrogates the label set of the Node this process runs on. It uses this information to select the specific PoolConfig file corresponding to the Node. Returns the selected PoolConfig file, the name of the file, or an error if it was impossible to determine which config file is applicable.
func ReadPoolConfigFile ¶
func ReadPoolConfigFile(name string) (PoolConfig, error)
ReadPoolConfigFile reads a pool configuration file
func (PoolConfig) SelectPool ¶
func (poolConf PoolConfig) SelectPool(prefix string) Pool
SelectPool returns the exact CPUSet belonging to either the exclusive, shared, or default pool of one PoolConfig object An empty CPUSet is returned in case the configuration does not contain the requested type