How k8snetworkplumbingwg/sriov-network-device-plugin works
Main Components
a. Core Components:
• Device Plugin Manager (central controller)
• Resource Pools Manager
• Device Discovery System
• Device Selector Framework
• Resource Server
• Health Monitor (for link status)
b. External Interfaces:
• Kubernetes Device Plugin API
• Container Runtime Interface
• SR-IOV Network Resources
• CNI Plugin Integration Points
• Container Device Interface (CDI)
Key Architectural Elements
a. Resource Management Layer:
┌─────────────────────────────────────────┐
• Device Plugin Manager │
• ┬───────────────────┤
• Resource Pools │ Device Selector │
• Manager │ Framework │
• ┴───────────────────┘
b. Device Discovery and Management:
┌─────────────────────────────────────────┐
• Device Discovery System │
• ┬─────────────┬────────────┤
• SR-IOV VFs │ PCI PFs │ SFs │
• ┴─────────────┴────────────┘
Integration Points
• Communication with Kubernetes API server
• Integration with CNI plugins (Multus/DANM)
• Interaction with hardware devices
• Resource allocation flow
Resource Types
┌─────────────────────────────────────────┐
• Supported Device Types │
• ┬─────────────┬────────────┤
• NetDevice │ AccelDevice │ AuxNetDev │
• ┴─────────────┴────────────┘
Configuration Flow
┌─────────────┐ ┌──────────────┐ ┌────────────┐
• ConfigMap │ -> │Device Plugin │ -> │ Resource │
• (JSON) │ │ Manager │ │ Pools │
• ┘ └──────────────┘ └────────────┘
Implementation Details
Relationship between:
• Device discovery (/pkg/devices)
• Resource management (/pkg/resources)
• Provider implementations (/pkg/netdevice, /pkg/accelerator, /pkg/auxnetdevice)
• Utility functions (/pkg/utils)
Monitoring and Health Checks
Components for:
• Link status monitoring
• Device health checks
• Kubelet restart detection
• Resource updates
• The plugin's modular architecture
• Clear separation of concerns
• Extensibility points
• Resource management workflow
• Integration with Kubernetes ecosystem
This design captures the essence of a Kubernetes device plugin while showing the specific implementations for SR-IOV network resources management.