Documentation ¶
Index ¶
- Constants
- Variables
- func GetPodCPUPolicy(attr map[string]string) string
- func GetPodNUMANodeResult(pod *corev1.Pod) topologyv1alpha1.ZoneList
- func GetPodTargetContainerIndices(pod *corev1.Pod) []int
- func GetPodTopologyResult(pod *corev1.Pod) topologyv1alpha1.ZoneList
- func GuaranteedCPUs(container *corev1.Container) int
- func IsPodAwareOfTopology(attr map[string]string) *bool
- func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error)
- func ResourceListIgnoreZeroResources(r *framework.Resource) corev1.ResourceList
- type PodTopologyCache
- type TopologyMatch
- func (tm *TopologyMatch) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (tm *TopologyMatch) Name() string
- func (tm *TopologyMatch) PreBind(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (tm *TopologyMatch) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) *framework.Status
- func (tm *TopologyMatch) PreFilterExtensions() framework.PreFilterExtensions
- func (tm *TopologyMatch) Reserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (tm *TopologyMatch) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (tm *TopologyMatch) ScoreExtensions() framework.ScoreExtensions
- func (tm *TopologyMatch) Unreserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...)
Constants ¶
const ( ErrReasonNUMAResourceNotEnough = "node(s) had insufficient resource of NUMA node" ErrReasonFailedToGetNRT = "node(s) failed to get NRT" )
const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "NodeResourceTopologyMatch"
)
Variables ¶
var ( // SupportedPolicy is the valid cpu policy. SupportedPolicy = sets.NewString( topologyv1alpha1.AnnotationPodCPUPolicyNone, topologyv1alpha1.AnnotationPodCPUPolicyExclusive, topologyv1alpha1.AnnotationPodCPUPolicyNUMA, topologyv1alpha1.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) topologyv1alpha1.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) topologyv1alpha1.ZoneList
GetPodTopologyResult returns the Topology scheduling result of a pod.
func GuaranteedCPUs ¶
GuaranteedCPUs returns CPUs for guaranteed container.
func IsPodAwareOfTopology ¶
IsPodAwareOfTopology returns if the pod needs to be scheduled based on topology awareness.
func ResourceListIgnoreZeroResources ¶
func ResourceListIgnoreZeroResources(r *framework.Resource) corev1.ResourceList
ResourceListIgnoreZeroResources returns non-zero ResourceList from a framework.Resource.
Types ¶
type PodTopologyCache ¶
type PodTopologyCache interface { AssumePod(pod *corev1.Pod, zone topologyv1alpha1.ZoneList) error ForgetPod(pod *corev1.Pod) error PodCount() int GetPodTopology(pod *corev1.Pod) (topologyv1alpha1.ZoneList, error) }
PodTopologyCache is a cache which stores the pod topology scheduling result. It is used before the pod bound since the result has not been recorded into annotations yet.
func NewPodTopologyCache ¶
func NewPodTopologyCache(ctx context.Context, ttl time.Duration) PodTopologyCache
NewPodTopologyCache returns a PodTopologyCache.
type TopologyMatch ¶
type TopologyMatch struct { PodTopologyCache // contains filtered or unexported fields }
TopologyMatch plugin which run simplified version of TopologyManager's admit handler
func (*TopologyMatch) Filter ¶
func (tm *TopologyMatch) Filter( ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo, ) *framework.Status
Filter will check if there exists numa node which has sufficient resource for the pod.
func (*TopologyMatch) Name ¶
func (tm *TopologyMatch) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*TopologyMatch) PreBind ¶
func (tm *TopologyMatch) PreBind( ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string, ) *framework.Status
PreBind writes pod topology result annotations using the k8s client.
func (*TopologyMatch) PreFilter ¶
func (tm *TopologyMatch) PreFilter( ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ) *framework.Status
PreFilter invoked at the prefilter extension point.
func (*TopologyMatch) PreFilterExtensions ¶
func (tm *TopologyMatch) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
func (*TopologyMatch) Reserve ¶
func (tm *TopologyMatch) Reserve( ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string, ) *framework.Status
Reserve reserves topology of pod and saves status in cycle stateData.
func (*TopologyMatch) Score ¶
func (tm *TopologyMatch) Score( ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string, ) (int64, *framework.Status)
Score invoked at the Score extension point.
func (*TopologyMatch) ScoreExtensions ¶
func (tm *TopologyMatch) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
func (*TopologyMatch) Unreserve ¶
func (tm *TopologyMatch) Unreserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string)
Unreserve clears assumed Pod topology cache. It's idempotent, and does nothing if no cache found for the given pod.