filter

package
v1.7.3-hash-fix-backport Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	FilterReject(instanceTypes []*cloudprovider.InstanceType) (kept []*cloudprovider.InstanceType, rejected []*cloudprovider.InstanceType)
	Name() string
}

func CapacityBlockFilter

func CapacityBlockFilter(requirements scheduling.Requirements) Filter

CapacityBlockFilter creates a filter which selects the instance type with the cheapest capacity block offering if the provided requirements are for a reserved launch and the provided instance types have a capacity block offering. This filter is required because CreateFleet does not accept multiple capacity blocks in a given request. Ref: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-launch-instances-capacity-blocks-walkthrough.html

func CapacityReservationTypeFilter

func CapacityReservationTypeFilter(requirements scheduling.Requirements) Filter

CapacityReservationTypeFilter creates a Filter which ensures there aren't instance types with offerings from multiple capacity reservation types. This addresses a CreateFleet limitation, where we can only specify a single market type (i.e. "on-demand" or "capacity-block").

func CompatibleAvailableFilter

func CompatibleAvailableFilter(requirements scheduling.Requirements, requests corev1.ResourceList) Filter

CompatibleAvailableFilter removes instance types which do not have any compatible, available offerings. Other filters should not be used without first using this filter.

func ExoticInstanceTypeFilter

func ExoticInstanceTypeFilter(requirements scheduling.Requirements) Filter

ExoticInstanceTypeFilter will remove instances with GPUs and accelerators, along with metal instances, if doing so doesn't filter out all instance types. This ensures Karpenter only launches these instances if the NodeClaim explicitly requests them or all other compatible instance types are unavailable.

func ReservedOfferingFilter

func ReservedOfferingFilter(requirements scheduling.Requirements) Filter

ReservedOfferingFilter creates a Filter which ensures there's only a single reserved offering per zone. This addresses a limitation of the CreateFleet API, which limits calls to specifying a single offering per pool. If there are multiple offerings in the same pool, the offering with the greatest capacity will be selected.

func SpotInstanceFilter

func SpotInstanceFilter(requirements scheduling.Requirements) Filter

SpotInstanceFilter removes all instances with spot offerings which are more expensive than the cheapest compatible and available on-demand offering. This ensures we don't launch with a more expensive spot instance for a mixed-launch NodeClaim. Note that instance types with available, compatible reserved offerings will not be filtered out. NOTE: This filter assumes all provided instance types have compatible and available offerings

Jump to

Keyboard shortcuts

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