Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func GetPodCPUPolicy(attr map[string]string) string
- func GetPodNUMANodeResult(pod *corev1.Pod) topologyapi.ZoneList
- func GetPodTargetContainerIndices(pod *corev1.Pod) []int
- func GetPodTopologyResult(pod *corev1.Pod) topologyapi.ZoneList
- func GuaranteedCPUs(container *corev1.Container) int
- type ActivePodsByPolicyFunc
- type ActivePodsFunc
- type CPUManager
- type LoopControl
- type NodeInfo
- type Policy
- type TopologyResult
Constants ¶
View Source
const (
PolicyNameStatic = "static"
)
Variables ¶
View Source
var DefaultExclusiveCPUSet = func() cpuset.CPUSet { return cpuset.NewCPUSet() }
View Source
var ( // SupportedPolicy is the valid cpu policy. SupportedPolicy = sets.NewString( topologyapi.AnnotationPodCPUPolicyNone, topologyapi.AnnotationPodCPUPolicyExclusive, topologyapi.AnnotationPodCPUPolicyNUMA, topologyapi.AnnotationPodCPUPolicyImmovable, ) )
Functions ¶
func GetPodCPUPolicy ¶
GetPodCPUPolicy returns the cpu policy of pod, only supports none, exclusive, numa and immovable.
func GetPodNUMANodeResult ¶
func GetPodNUMANodeResult(pod *corev1.Pod) topologyapi.ZoneList
GetPodNUMANodeResult returns the NUMA node scheduling result of a pod.
func GetPodTargetContainerIndices ¶
GetPodTargetContainerIndices returns all pod whose cpus could be allocated.
func GetPodTopologyResult ¶
func GetPodTopologyResult(pod *corev1.Pod) topologyapi.ZoneList
GetPodTopologyResult returns the Topology scheduling result of a pod.
func GuaranteedCPUs ¶
GuaranteedCPUs returns CPUs for guaranteed container.
Types ¶
type ActivePodsByPolicyFunc ¶
ActivePodsByPolicyFunc is a function that returns a list of pods which belong to specified policy.
type ActivePodsFunc ¶
ActivePodsFunc is a function that returns a list of pods to reconcile.
type CPUManager ¶
func NewCPUManager ¶
func NewCPUManager( nodeName string, defaultCPUPolicy string, reconcilePeriod time.Duration, cadvisorManager cadvisor.Manager, containerRuntime criapis.RuntimeService, stateFileDirectory string, podInformer coreinformers.PodInformer, nrtInformer topologyinformer.NodeResourceTopologyInformer, ) (CPUManager, error)
type Policy ¶
type Policy interface { Name() string Start(s cpumanagerstate.State, nodeTopology TopologyResult) error // Allocate call is idempotent Allocate(s cpumanagerstate.State, pod *corev1.Pod, container *corev1.Container, mode string, tr TopologyResult) error // RemoveContainer call is idempotent RemoveContainer(s cpumanagerstate.State, podUID string, containerName string) // GetAllocatableCPUs returns the assignable (not allocated) CPUs GetAllocatableCPUs(m cpumanagerstate.State) (cpuset.CPUSet, error) GetSharedCPUs(s cpumanagerstate.State) cpuset.CPUSet // GetExclusiveCPUSet returns the set of all CPUs minus the default set. GetExclusiveCPUSet(s cpumanagerstate.State) cpuset.CPUSet // GetReservedCPUSet returns the set of reserved CPUs GetReservedCPUSet() cpuset.CPUSet }
Policy implements logic for pod container to CPU assignment.
func NewStaticPolicy ¶
func NewStaticPolicy(topology *cputopo.CPUTopology, getPodFunc ActivePodsByPolicyFunc) Policy
NewStaticPolicy builds a new staticPolicy.
type TopologyResult ¶
func NewTopologyResult ¶
func NewTopologyResult() TopologyResult
func (TopologyResult) CPUs ¶
func (tr TopologyResult) CPUs() int
func (TopologyResult) CPUsInNUMANodes ¶
func (tr TopologyResult) CPUsInNUMANodes(ids ...int) int
func (TopologyResult) NumReservedCPUs ¶
func (tr TopologyResult) NumReservedCPUs() int
func (TopologyResult) NumReservedCPUsInNUMANodes ¶
func (tr TopologyResult) NumReservedCPUsInNUMANodes(ids ...int) int
Click to show internal directories.
Click to hide internal directories.