package nodeports

import "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports"

Index

Constants

const (
	// Name is the name of the plugin used in the plugin registry and configurations.
	Name = names.NodePorts

	// ErrReason when node ports aren't available.
	ErrReason = "node(s) didn't have free ports for the requested pod ports"
)

Functions

func Fits

func Fits(pod *v1.Pod, nodeInfo fwk.NodeInfo) bool

Fits checks if the pod has any ports conflicting with nodeInfo's ports. It returns true if there are no conflicts (which means that pod fits the node), otherwise false.

func New

New initializes a new plugin and returns it.

Types

type NodePorts

type NodePorts struct {
	// contains filtered or unexported fields
}

NodePorts is a plugin that checks if a node has free ports for the requested pod ports.

func (*NodePorts) EventsToRegister

func (pl *NodePorts) EventsToRegister(_ context.Context) ([]fwk.ClusterEventWithHint, error)

EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.

func (*NodePorts) Filter

func (pl *NodePorts) Filter(ctx context.Context, cycleState fwk.CycleState, pod *v1.Pod, nodeInfo fwk.NodeInfo) *fwk.Status

Filter invoked at the filter extension point.

func (*NodePorts) Name

func (pl *NodePorts) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*NodePorts) PreFilter

func (pl *NodePorts) PreFilter(ctx context.Context, cycleState fwk.CycleState, pod *v1.Pod, nodes []fwk.NodeInfo) (*fwk.PreFilterResult, *fwk.Status)

PreFilter invoked at the prefilter extension point.

func (*NodePorts) PreFilterExtensions

func (pl *NodePorts) PreFilterExtensions() fwk.PreFilterExtensions

PreFilterExtensions do not exist for this plugin.

func (*NodePorts) SignPod

func (pl *NodePorts) SignPod(ctx context.Context, pod *v1.Pod) ([]fwk.SignFragment, *fwk.Status)

NodePort feasibility and scheduling is based on the host ports for the containers.

Source Files

node_ports.go

Version
v1.35.1 (latest)
Published
Feb 10, 2026
Platform
linux/amd64
Imports
9 packages
Last checked
2 months ago

Tools for package owners.