NVIDIA / topograph

A toolkit for discovering cluster network topology.
Apache License 2.0
6 stars 0 forks source link

KEP: Cluster Network Topology Standardization #30

Closed dmitsh closed 1 day ago

dmitsh commented 1 week ago

Kubernetes Enhancement Proposal: Cluster Network Topology Standardization

Summary

This document proposes a standard for declaring cluster network topology in Kubernetes, representing the hierarchy of nodes, switches, and interconnects. In this context, a switch can refer to a physical network device or a collection of such devices with close proximity and functionality.

Motivation

Understanding the cluster network topology is essential for optimizing the placement of workloads that require intensive inter-node communication. Currently, there is no standardized way to represent this information in Kubernetes, making it challenging to develop control plane components and applications that can leverage topology awareness.

This information might be useful for various components and features, including:

Cluster Topology Sources

Cluster topology information can be derived from various sources:

Proposal

We propose new node label and annotation types to capture network topology information:

Network Topology Label

Format: network.topology.kubernetes.io/<nw-switch-type>: <switch-name>

Network QoS Annotation

Format: network.qos.kubernetes.io/switches: <QoS>

This structure can be easily extended with additional network QoS metrics in the future.

Reserved Network Types

We have introduced reserved network types to better accommodate common network hierarchies. These reserved network types include the following predefined names and characteristics:

  1. accelerator: Network interconnect for direct accelerator communication (e.g., Multi-node NVLink interconnect between NVIDIA GPUs)
  2. block: Rack-level switches connecting hosts in one or more racks as a block.
  3. datacenter: Spine-level switches connecting multiple blocks inside a datacenter.
  4. zone: Zonal switches connecting multiple datacenters inside an availability zone.

When using reserved network types, Network QoS Annotations become optional. In the absence of these annotations, it is assumed that performance within each network layer is uniform.

The scheduler will prioritize switches according to the order outlined above, providing a standardized approach for network-aware scheduling across a range of configurations.

If provided, Network QoS Annotations can be used to refine and enhance the details of link performance, enabling more precise scheduling decisions.

Example of Network Topology Labels with reserved network types:

network.topology.kubernetes.io/accelerator: nvl72-a
network.topology.kubernetes.io/block: block-b
network.topology.kubernetes.io/datacenter: dc-c
network.topology.kubernetes.io/zone: zone-d

Example of Network QoS Annotations that complements the example above:

network.qos.kubernetes.io/switches: {
   "nvl72-a": {
      "latency": "2us",
      "bandwidth": "100Gbps"
   },
   "block-b": {
      "latency": "50us",
      "bandwidth": "40Gbps"
   },
   "dc-c": {
      "latency": "500us",
      "bandwidth": "20Gbps"
   },
  "zone-d": {
      "latency": "1ms",
      "bandwidth": "10Gbps"
   }
}

Extensibility and Future-Proofing

This proposal is designed with extensibility in mind, enabling the use of custom network types. This ensures that the standard can adapt to future advancements in cluster networking without requiring significant overhauls.

For custom network types, Network QoS Annotations are required, with distance being the minimum mandatory metric. Specifying latency and bandwidth is optional, but including them can offer a more detailed view of link performance, enabling more efficient scheduling decisions.

Example of network topology with custom network types

Node Labels:

network.topology.kubernetes.io/area: sw-a
network.topology.kubernetes.io/sector: block-b
network.topology.kubernetes.io/center: center-c

Node Annotations:

network.qos.kubernetes.io/switches: {
   "sw-a": {
      "distance": 1,
      "latency": "100ns",
      "bandwidth": "40Gbps"
   },
   "block-b": {
      "distance": 2,
      "latency": "500ns",
      "bandwidth": "20Gbps"
   },
   "center-c": {
      "distance": 3,
      "latency": "1ms",
      "bandwidth": "10Gbps"
   }
}
dmitsh commented 1 day ago

Closing in favor of https://github.com/kubernetes/enhancements/issues/4962