extender

package
v0.69.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartDemandGC

func StartDemandGC(
	ctx context.Context,
	podInformer coreinformers.PodInformer,
	manager demands.Manager,
)

StartDemandGC initializes the DemandGC which handles events in the background

Types

type ClusterRequests

type ClusterRequests map[string]NodeRequests

ClusterRequests represents the pod requests in the cluster, indexed by node name

type DemandGC

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

DemandGC is a background pod event handler which deletes any demand we have previously created for a pod when a pod gets scheduled. We also delete demands elsewhere in the extender when we schedule the pod, but those can miss some demands due to race conditions.

type NodeRequests

type NodeRequests map[types.UID]PodRequestInfo

NodeRequests represents the currently present pod requests on this node, indexed by pod uid

type OverheadComputer

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

OverheadComputer computes non spark scheduler managed pods total resources periodically

func NewOverheadComputer

func NewOverheadComputer(
	ctx context.Context,
	podInformer coreinformers.PodInformer,
	resourceReservationManager ResourceReservationManager,
	nodeLister corelisters.NodeLister) *OverheadComputer

NewOverheadComputer creates a new OverheadComputer instance

func (OverheadComputer) GetNonSchedulableOverhead

func (o OverheadComputer) GetNonSchedulableOverhead(ctx context.Context, nodes []*v1.Node) resources.NodeGroupResources

GetNonSchedulableOverhead fills non-schedulable overhead information for given nodes. Non-schedulable overhead is overhead by pods that are running, but do not have 'spark-scheduler' as their scheduler name.

func (OverheadComputer) GetOverhead

func (o OverheadComputer) GetOverhead(ctx context.Context, nodes []*v1.Node) resources.NodeGroupResources

GetOverhead fills overhead information for given nodes.

type PodRequestInfo

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

PodRequestInfo holds information about a pod and its requested resources

type ResourceReservationManager

type ResourceReservationManager interface {
	GetResourceReservation(appID string, namespace string) (*v1beta2.ResourceReservation, bool)
	PodHasReservation(ctx context.Context, pod *v1.Pod) bool
	GetReservedResources() resources.NodeGroupResources
	CompactDynamicAllocationApplications(ctx context.Context)
	ReserveForExecutorOnUnboundReservation(ctx context.Context, executor *v1.Pod, node string) error
	ReserveForExecutorOnRescheduledNode(ctx context.Context, executor *v1.Pod, node string) error
	GetRemainingAllowedExecutorCount(ctx context.Context, appID string, namespace string) (int, error)
	GetSoftResourceReservation(appID string) (*cache.SoftReservation, bool)
	FindAlreadyBoundReservationNode(ctx context.Context, executor *v1.Pod) (string, bool, error)
	FindUnboundReservationNodes(ctx context.Context, executor *v1.Pod) ([]string, bool, error)
	CreateReservations(
		ctx context.Context,
		driver *v1.Pod,
		applicationResources *types.SparkApplicationResources,
		driverNode string,
		executorNodes []string) (*v1beta2.ResourceReservation, error)
}

ResourceReservationManager is a central point which manages the creation and reading of both resource reservations and soft reservations

func NewResourceReservationManager

func NewResourceReservationManager(
	ctx context.Context,
	resourceReservations *cache.ResourceReservationCache,
	softReservationStore *cache.SoftReservationStore,
	podLister *SparkPodLister,
	informer coreinformers.PodInformer) ResourceReservationManager

NewResourceReservationManager creates and returns a ResourceReservationManager

type SparkPodLister

type SparkPodLister struct {
	corelisters.PodLister
	// contains filtered or unexported fields
}

SparkPodLister is a PodLister which can also list drivers per node selector

func NewSparkPodLister

func NewSparkPodLister(delegate corelisters.PodLister, instanceGroupLabel string) *SparkPodLister

NewSparkPodLister creates and initializes a SparkPodLister

func (SparkPodLister) ListEarlierDrivers

func (s SparkPodLister) ListEarlierDrivers(driver *v1.Pod) ([]*v1.Pod, error)

ListEarlierDrivers lists earlier driver than the given driver that has the same node selectors

type SparkSchedulerExtender

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

SparkSchedulerExtender is a kubernetes scheduler extended responsible for ensuring a spark driver and all of the executors can be scheduled together given current resources available across the nodes

func NewExtender

func NewExtender(
	nodeLister corelisters.NodeLister,
	podLister *SparkPodLister,
	resourceReservations *cache.ResourceReservationCache,
	softReservationStore *cache.SoftReservationStore,
	resourceReservationManager ResourceReservationManager,
	coreClient corev1.CoreV1Interface,
	demandsManager demands.Manager,
	apiExtensionsClient apiextensionsclientset.Interface,
	isFIFO bool,
	fifoConfig config.FifoConfig,
	binpacker *internalbinpacker.Binpacker,
	shouldScheduleDynamicallyAllocatedExecutorsInSameAZ bool,
	overheadComputer *OverheadComputer,
	instanceGroupLabel string,
	nodeSorter *ns.NodeSorter,
	wasteMetricsReporter *metrics.WasteMetricsReporter) *SparkSchedulerExtender

NewExtender is responsible for creating and initializing a SparkSchedulerExtender

func (*SparkSchedulerExtender) Predicate

Predicate is responsible for returning a filtered list of nodes that qualify to schedule the pod provided in the ExtenderArgs

type UnschedulablePodMarker

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

UnschedulablePodMarker checks for spark scheduler managed pending driver pods and checks if they can fit if the cluster was empty, else marks them with a custom pod condition.

func NewUnschedulablePodMarker

func NewUnschedulablePodMarker(
	nodeLister corelisters.NodeLister,
	podLister corelisters.PodLister,
	coreClient corev1.CoreV1Interface,
	overheadComputer *OverheadComputer,
	binpacker *internalbinpacker.Binpacker,
	timeoutDuration time.Duration) *UnschedulablePodMarker

NewUnschedulablePodMarker creates a new UnschedulablePodMarker

func (*UnschedulablePodMarker) DoesPodExceedClusterCapacity

func (u *UnschedulablePodMarker) DoesPodExceedClusterCapacity(ctx context.Context, driver *v1.Pod) (bool, error)

DoesPodExceedClusterCapacity checks if the provided driver pod could ever fit to the cluster

func (*UnschedulablePodMarker) Start

func (u *UnschedulablePodMarker) Start(ctx context.Context)

Start starts periodic scanning for unschedulable applications

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL