Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivePodsFunc ¶
ActivePodsFunc is a function that returns a list of active pods
type Manager ¶
type Manager interface { // Start is called during Kubelet initialization. Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService, initialContainers containermap.ContainerMap) error // AddContainer is called between container create and container start // so that initial memory 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 // Allocate is called to pre-allocate memory resources during Pod admission. // This must be called at some point prior to the AddContainer() call for a container, e.g. at pod admission time. Allocate(pod *v1.Pod, container *v1.Container) error // RemoveContainer is called after Kubelet decides to kill or delete a // container. After this call, any memory allocated to the container is freed. RemoveContainer(containerID string) error // State returns a read-only interface to the internal memory manager state. State() state.Reader // GetTopologyHints implements the topologymanager.HintProvider Interface // and is consulted to achieve NUMA aware resource alignment among this // and other resource controllers. GetTopologyHints(*v1.Pod, *v1.Container) map[string][]topologymanager.TopologyHint // GetPodTopologyHints implements the topologymanager.HintProvider Interface // and is consulted to achieve NUMA aware resource alignment among this // and other resource controllers. GetPodTopologyHints(*v1.Pod) map[string][]topologymanager.TopologyHint }
Manager interface provides methods for Kubelet to manage pod memory.
func NewFakeManager ¶
func NewFakeManager() Manager
NewFakeManager creates empty/fake memory manager
func NewManager ¶
func NewManager(policyName string, machineInfo *cadvisorapi.MachineInfo, nodeAllocatableReservation v1.ResourceList, reservedMemory []kubeletconfig.MemoryReservation, stateFileDirectory string, affinity topologymanager.Store) (Manager, error)
NewManager returns new instance of the memory manager
type Policy ¶
type Policy interface { Name() string Start(s state.State) error // Allocate call is idempotent Allocate(s state.State, pod *v1.Pod, container *v1.Container) error // RemoveContainer call is idempotent RemoveContainer(s state.State, podUID string, containerName string) error // GetTopologyHints implements the topologymanager.HintProvider Interface // and is consulted to achieve NUMA aware resource alignment among this // and other resource controllers. GetTopologyHints(s state.State, pod *v1.Pod, container *v1.Container) map[string][]topologymanager.TopologyHint // GetPodTopologyHints implements the topologymanager.HintProvider Interface // and is consulted to achieve NUMA aware resource alignment among this // and other resource controllers. GetPodTopologyHints(s state.State, pod *v1.Pod) map[string][]topologymanager.TopologyHint }
Policy implements logic for pod container to a memory assignment.
func NewPolicyStatic ¶
func NewPolicyStatic(machineInfo *cadvisorapi.MachineInfo, reserved systemReservedMemory, affinity topologymanager.Store) (Policy, error)
NewPolicyStatic returns new static policy instance
Source Files
¶
Click to show internal directories.
Click to hide internal directories.