cpumanager

package
v1.16.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 18 Imported by: 51

Documentation

Index

Constants

View Source
const PolicyNone policyName = "none"

PolicyNone name of none policy

View Source
const PolicyStatic policyName = "static"

PolicyStatic is the name of the static policy

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivePodsFunc

type ActivePodsFunc func() []*v1.Pod

ActivePodsFunc is a function that returns a list of pods to reconcile.

type Manager

type Manager interface {
	// Start is called during Kubelet initialization.
	Start(activePods ActivePodsFunc, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService)

	// AddContainer is called between container create and container start
	// so that initial CPU affinity settings can be written through to the
	// container runtime before the first process begins to execute.
	AddContainer(p *v1.Pod, c *v1.Container, containerID string) error

	// RemoveContainer is called after Kubelet decides to kill or delete a
	// container. After this call, the CPU manager stops trying to reconcile
	// that container and any CPUs dedicated to the container are freed.
	RemoveContainer(containerID string) error

	// State returns a read-only interface to the internal CPU manager state.
	State() state.Reader

	// GetTopologyHints implements the Topology Manager Interface and is
	// consulted to make Topology aware resource alignments
	GetTopologyHints(pod v1.Pod, container v1.Container) map[string][]topologymanager.TopologyHint
}

Manager interface provides methods for Kubelet to manage pod cpus.

func NewFakeManager

func NewFakeManager() Manager

NewFakeManager creates empty/fake cpu manager

func NewManager

func NewManager(cpuPolicyName string, reconcilePeriod time.Duration, machineInfo *cadvisorapi.MachineInfo, numaNodeInfo topology.NUMANodeInfo, nodeAllocatableReservation v1.ResourceList, stateFileDirectory string, affinity topologymanager.Store) (Manager, error)

NewManager creates new cpu manager based on provided policy

type Policy

type Policy interface {
	Name() string
	Start(s state.State)
	// AddContainer call is idempotent
	AddContainer(s state.State, pod *v1.Pod, container *v1.Container, containerID string) error
	// RemoveContainer call is idempotent
	RemoveContainer(s state.State, containerID string) error
}

Policy implements logic for pod container to CPU assignment.

func NewNonePolicy

func NewNonePolicy() Policy

NewNonePolicy returns a cupset manager policy that does nothing

func NewStaticPolicy

func NewStaticPolicy(topology *topology.CPUTopology, numReservedCPUs int, affinity topologymanager.Store) Policy

NewStaticPolicy returns a CPU manager policy that does not change CPU assignments for exclusively pinned guaranteed containers after the main container process starts.

Directories

Path Synopsis
Package topology contains helpers for the CPU manager.
Package topology contains helpers for the CPU manager.

Jump to

Keyboard shortcuts

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