Skip to content

NIC / CPU alignment (by supporting "resource.kubernetes.io/pcieRoot" list attribute) #114

@everpeace

Description

@everpeace

ref: google/dranet#92

Kubernetes v1.36 will release KEP-5491: DRA: List Types for Attributes with alpha. Thus, supporting "resource.kubernetes.io/pcieRoot" list attribute can achieve CPU/NIC alignment as below:

#
# NOTE: DRAListTypeAttributes feature gate is required
# 
apiVersion: resource.k8s.io/v1
kind: ResourceSlice
metadata:
  name: cpu-slice
spec:
  driver: dra.cpu
  nodeName: my-node
  devices:
  - name: cpu0
    attributes:
      # Keep grouping cpu cores by NUMA nodes
      numaNodeId:
        int: 0
      # Additional attribute
      # for pcieRoot (multiple) that each core is affine to.
      # Note: CPU core could be affine to multiple PCIe Roots.
      resource.kubernetes.io/pcieRoot:
        strings: ["pci0000:00", "pci0000:80"]
      ..and other attrs...    
---
apiVersion: resource.k8s.io/v1
kind: ResourceSlice
metadata:
  name: nic-slice
spec:
  driver: dranet.net
  nodeName: my-node
  devices:
  - name: nic0
    attributes:
      # DRANET already supports this standard attribute
      resource.kubernetes.io/pcieRoot:
        string: "pci0000:80"
      ..and other attrs...
---
apiVersion: resource.k8s.io/v1
kind: ResourceClaim
metadata:
  name: cpu-nic-alignment
spec:
  devices:
    requests:
    - name: cpu
      deviceClassName: dra.cpu
    - name: nic
      deviceClassName: dranet.net
    constraints:
    - requestNames: ["cpu", "nic"]
      # DRAListTypeAttributes feature gate can select
      # cpu and nic that have a common PCIe root address
      # (scalar value will be converted to a singleton implicitly)
      matchAttribute: "resource.kubernetes.io/pcieRoot"

cc/ @aojea @pravk03

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions