kubernetes: k8s.io/kubernetes/pkg/kubelet/cm/cpumanager Index | Files | Directories

package cpumanager

import "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"


Package Files

container_map.go cpu_assignment.go cpu_manager.go fake_cpu_manager.go policy.go policy_none.go policy_static.go topology_hints.go


const PolicyNone policyName = "none"

PolicyNone name of none policy

const PolicyStatic policyName = "static"

PolicyStatic is the name of the static policy

type ActivePodsFunc Uses

type ActivePodsFunc func() []*v1.Pod

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

type Manager Uses

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 Uses

func NewFakeManager() Manager

NewFakeManager creates empty/fake cpu manager

func NewManager Uses

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 Uses

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 Uses

func NewNonePolicy() Policy

NewNonePolicy returns a cupset manager policy that does nothing

func NewStaticPolicy Uses

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.


topologyPackage topology contains helpers for the CPU manager.

Package cpumanager imports 18 packages (graph) and is imported by 31 packages. Updated 2019-09-11. Refresh now. Tools for package owners.