Skip to content

CA DRA: implement DeviceClassResolver() #8742

@towca

Description

@towca

Which component are you using?:

/area cluster-autoscaler
/area core-autoscaler
/wg device-management

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

A new method was added to the scheduler framework's SharedDRAManager as part of KEP-5004 (in kubernetes/kubernetes#134326):

// DeviceClassResolver resolves device class names from extended resource names.
type DeviceClassResolver interface {
	// GetDeviceClass returns the device class name for the given extended resource name.
	// Returns empty string if no mapping exists for the resource name or
	// the DRAExtendedResource feature is disabled.
	GetDeviceClass(resourceName v1.ResourceName) string
}

type SharedDRAManager interface {
        ...
	DeviceClassResolver() DeviceClassResolver
}

Cluster Autoscaler needs to adapt the DRA Snapshot to implement DeviceClassResolver() and GetDeviceClass() based on the tracked classes.

Describe the solution you'd like.:

Cluster Autoscaler internally tracks DeviceClasses similarly to ResourceClaims and ResourceSlices, so that scheduling simulations within a single CA loop operate on a consistent state of all DRA objects. DeviceClasses are however never modified by CA during the simulations, so we should be able to just compute and cache the resourceName->className mapping when creating the Snapshot in NewSnapshot(). The mapping is based on the DeviceClass.DeviceClassSpec.ExtendedResourceName field of the provided deviceClasses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cluster-autoscalerarea/core-autoscalerDenotes an issue that is related to the core autoscaler and is not specific to any provider.wg/device-managementCategorizes an issue or PR as relevant to WG Device Management.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions