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

package cpumanager

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

Index

Constants

const CPUManagerStateFileName = "cpu_manager_state"

CPUManagerStateFileName is the name file name where cpu manager stores it's state

const PolicyNone policyName = "none"

PolicyNone name of none policy

const PolicyStatic policyName = "static"

PolicyStatic is the name of the static policy

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
}

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, nodeAllocatableReservation v1.ResourceList, stateFileDirecory string) (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) Policy

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

Source Files

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

Directories

PathSynopsis
pkg/kubelet/cm/cpumanager/state
pkg/kubelet/cm/cpumanager/topologyPackage topology contains helpers for the CPU manager.
Version
v1.10.8
Published
Sep 13, 2018
Platform
js/wasm
Imports
17 packages
Last checked
7 seconds ago

Tools for package owners.