Skip to content

Commit ff01858

Browse files
authored
Merge pull request #5316 from gauravkghildiyal/kep-4381-dra-standard-attributes
KEP-4381: Define standard device attributes
2 parents cb667bc + de41a26 commit ff01858

File tree

1 file changed

+39
-5
lines changed
  • keps/sig-node/4381-dra-structured-parameters

1 file changed

+39
-5
lines changed

keps/sig-node/4381-dra-structured-parameters/README.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ spec:
568568
version: 11.1.42
569569
powerSavingSupported:
570570
bool: true
571-
dra.k8s.io/pciRoot: # a fictional standardized attribute, not actually part of this KEP
571+
resource.kubernetes.io/pcieRoot:
572572
string: pci-root-0
573573
capacity:
574574
memory: 16Gi
@@ -578,10 +578,14 @@ Compared to labels, attributes have values of exactly one type. Quantities are d
578578
in the separate `capacity` map. As described later on, both sets can be used in CEL expressions to select a
579579
specific resource for allocation on a node.
580580

581-
To avoid any future conflicts, we reserve any attributes with the ".k8s.io/" domain prefix
582-
for future use and standardization by Kubernetes. This could be used to describe
583-
topology across resources from different vendors, for example, but this is out-
584-
of-scope for now.
581+
We are reserving the `kubernetes.io/` domain (and subdomains) prefix for
582+
attributes and capacities for standardization by the Kubernetes project. This
583+
reservation allows us to define common attributes that can describe hardware
584+
characteristics across resources from different vendors. Currently, we are
585+
defining one such standard attribute: `resource.kubernetes.io/pcieRoot`. Details
586+
on its meaning and how it should be exposed by DRA drivers are available in the
587+
[API design section under ResourceSlice's](#resourceslice) QualifiedName
588+
definition.
585589

586590
**Note:** If a driver needs to remove a device or change its attributes,
587591
then there is a risk that a claim gets allocated based on the old
@@ -594,6 +598,19 @@ would allow us to delete the pod and trying again with a new one, but is not don
594598
at the moment because admission checks cannot be retried if a check finds
595599
a transient problem.
596600

601+
**Note:** The immediate motivation for standardizing attributes largely stems
602+
from the current behavior of the `MatchAttribute` constraint, which relies on
603+
exact value matching. While this KEP provides a solution for many cross-driver
604+
alignment needs, a more flexible long-term solution is envisioned with
605+
[KEP-5254: DRA support for MatchExpression
606+
constraints](https://github.com/kubernetes/enhancements/issues/5254) (a
607+
work-in-progress). That proposal aims to introduce a `MatchExpression`
608+
constraint, allowing devices to be evaluated against CEL expressions, which will
609+
enable more complex and dynamic selection criteria. However, solving this
610+
critical alignment problem today is essential for latency-sensitive workloads.
611+
Standardizing attributes helps achieve this without introducing any conflicts
612+
with the future capabilities of KEP-5254.
613+
597614
### Using structured parameters
598615

599616
A ResourceClaim is a request to allocate one or more devices. Each request in a
@@ -1212,6 +1229,23 @@ const ResourceSliceMaxAttributesAndCapacitiesPerDevice = 32
12121229
// domain prefix are assumed to be part of the driver's domain. Attributes
12131230
// or capacities defined by 3rd parties must include the domain prefix.
12141231
//
1232+
// The Kubernetes project reserves the "kubernetes.io/" domain prefix for
1233+
// standardizing attributes and capacities. DRA drivers **SHOULD** use these
1234+
// standardized names if they define a characteristic of a device that matches
1235+
// the intent of a standard attribute (or capacity) name. This ensures
1236+
// consistency and interoperability across different drivers when conveying the
1237+
// same idea.
1238+
//
1239+
// Currently, the following standard attributes have been defined:
1240+
//
1241+
// 1. `resource.kubernetes.io/pcieRoot`: A string value in the format
1242+
// `pci<domain>:<bus>`, referring to a PCIe (Peripheral Component
1243+
// Interconnect Express) Root Complex. This attribute can be used to
1244+
// identify devices that share the same PCIe Root Complex. DRA drivers MAY
1245+
// determine this value by inspecting the hierarchical path of the device's
1246+
// entry in sysfs (e.g., `/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0`),
1247+
// where the `pci<domain>:<bus>` segment at the beginning of the real path
1248+
// identifies the Root Complex (e.g., `pci0000:00`).
12151249
//
12161250
// The maximum length for the DNS subdomain is 63 characters (same as
12171251
// for driver names) and the maximum length of the C identifier

0 commit comments

Comments
 (0)