Kubernetes Network Drivers
The Future of Kubernetes Networking
aojea@google.com
Mar 2025
Dec 2022
User stories
Dec 2022
Jan 2024
Kubernetes networking (today)
… and its consequences
Running a Pod are ~ two CRI operations
Kubernetes use network plugins to provide the network functionality:
REST
Network CNI plugin process
CNI binary
Container Runtime
OCI Runtime
CNI Spec
OCI Spec
CRI-API
REST
1. create namespaces
2. create network interface and assign IPs
3. create containers
Kubernetes Contributor Summit EU
Apr 2024
Dec 2022
Jan 2024
SIG Network, Mar 2024
The Future of Kubernetes Networking
1. The Need for a High-Level API
2. The Need for a Low-Level API
High Level API: DRA
control
plane
pods
pods
dra-net
dra- net
DRA
apiVersion: resource.k8s.io/v1alpha3
kind: ResourceSlice
…
spec:
devices:
- basic:
attributes:
vpc:
string: "blue"
encapsulation:
string: ether
ip:
string: 169.254.123.1/24
apiVersion: resource.k8s.io/v1alpha3
kind: ResourceSlice
Request Resources
apiVersion: resource.k8s.io/v1alpha3
kind: ResourceClaimTemplate
metadata:
name: nccl-interfaces
spec:
spec:
devices:
requests:
- name: net1
deviceClassName: net1
control
plane
pods
pods
dranet
dranet
DRA
apiVersion: resource.k8s.io/v1alpha3
kind: DeviceClass
metadata:
name: net1
spec:
selectors:
- cel:
expression: device.driver == "networking.k8s.io"
apiVersion: v1
kind: Pod
metadata:
name: pod1
labels:
app: pod
spec:
containers:
- name: ctr1
image: registry.k8s.io/e2e-test-images/agnhost:2.39
resourceClaims:
- name: nccl-networks
resourceClaimTemplateName: nccl-interfaces
- name: nccl-network
resourceClaimName: nccl-interface
apiVersion: resource.k8s.io/v1alpha3
kind: ResourceClaim
metadata:
name: nccl-interface
spec:
spec:
devices:
requests:
- name: net1
deviceClassName: net1
Scheduler allocates based on the resourceslices and claims
User reference in the Pod the ResourceClaim or ResourceClaimTemplate
Admin defines some DeviceClass on the cluster
Low Level API: OCI Spec “Linux Network Devices”
OCI Specification
CRI API
OCI defines how runtime implementations run OCI-compliant bundles and container configuration, containing low-level OS and host-specific details, on a particular platform.
Support for declarative configuration of Linux Network Devices
No root capabilities required for network plugins
Low Level API: Network Interfaces
CNI:
Just add the PodIPs and the default interface. This is the problem it solves and solves it well, we don’t want to build on this hook.
NRI participates on all the Pod lifecycle hooks, has access to the networking information and runs as a daemon.
Preprovision of the Network Interface.
CDI
Can generate the json file to patch the OCI spec to include the network interface
The “bumpy” road so far
Kubernetes Contributor Summit EU, Apr 2024
Dec 2022
Jan 2024
SIG Network, Mar 2024
Oct 2024
Apr 2025
Kubernetes Network Drivers
Kubernetes Network Drivers use DRA to expose Networks resources at the Node level that can be referenced by all the Pod (or all containers)
The network driver, before the RunPodSandbox is called, receives the NodePrepareResources rpc with the Devices and Configuration to use in the NRI hook.
This allows to keep backwards compatibility and remove the dependency in the existing monolithic network plugins and make networking composable.
CRI-API
Network
Driver
NRI / CDI
DRA
Secondary Network Interfaces
Additional network functionality
PodIPs