How mellanox/network-operator works
NVIDIA Network Operator reconciles Kubernetes networking custom resources into cluster components and secondary-network resources. The main workflow is a NICClusterPolicy or NICNodePolicy being validated, reconciled, and synchronized through state managers; controllers then report applied status. Separate controllers reconcile Macvlan, HostDevice, and IPoIB network resources. The README documents driver, device-plugin, CNI, IPAM, and NIC-configuration capabilities. Several implementation files are unsampled, so their internal wiring is omitted or marked unverified.
Main entry points: nicclusterpolicy_controller.go Cluster policy · manager.go State manager · nicnodepolicy_controller.go Node policy · main.go Operator startup
Components 27
Operator control
- Operator startup
main.go
Policy lifecycle
- Cluster policy
controllers/nicclusterpolicy_controller.go - Node policy
controllers/nicnodepolicy_controller.go - Policy validation
api/v1alpha1/validator/nicpolicy_webhook.go
Managed components
- State manager
pkg/state/manager.go - OFED driver
pkg/state/state_ofed.go - RDMA plugin
pkg/state/state_rdma_shared_device_plugin.go - State framework
pkg/state/state_skel.go - SR-IOV plugin
pkg/state/state_sriov_dp.go - IB Kubernetes
pkg/state/state_ib_kubernetes.go - Multus CNI
pkg/state/state_multus_cni.go - CNI plugins
pkg/state/state_cni_plugins.go - IPoIB CNI
pkg/state/state_ipoib_cni.go - NV IPAM
pkg/state/state_nv_ipam_cni.go - NIC configuration
pkg/state/state_nic_configuration_operator.go - DOCA images
pkg/docadriverimages/doca_drivers.go
Secondary networks
- Macvlan reconciler
controllers/macvlannetwork_controller.go - Macvlan state
pkg/state/state_macvlan_network.go - Host-device reconciler
controllers/hostdevicenetwork_controller.go - Host-device state
pkg/state/state_hostdevice_network.go - IPoIB reconciler
controllers/ipoibnetwork_controller.go - IPoIB state
pkg/state/state_ipoib_network.go
Node maintenance
- Upgrade coordinator
controllers/upgrade_controller.go - Drain controller
controllers/drain_controller.go - Drain requestor
pkg/drain/drain_requestor.go
Other components
- Kubernetes API
- Cluster operator
Connections 29
- Cluster operator → Kubernetes API: submits policies
- Kubernetes API → Cluster policy: watches policy
controllers/nicclusterpolicy_controller.go - Kubernetes API → Node policy: watches policy
controllers/nicnodepolicy_controller.go - Operator startup → Cluster policy: registers controller
main.go - Operator startup → Node policy: registers controller
main.go - Policy validation → Cluster policy: validates spec
- Cluster policy → State manager: syncs states
controllers/nicclusterpolicy_controller.go - Node policy → State manager: syncs states
- State manager → OFED driver: syncs state
- State manager → RDMA plugin: syncs state
- State manager → State framework: uses framework
- Cluster policy → DOCA images: uses image provider
controllers/nicclusterpolicy_controller.go - Cluster policy → SR-IOV plugin: configures component
- Cluster policy → IB Kubernetes: configures component
- Cluster policy → Multus CNI: configures component
- Cluster policy → CNI plugins: configures component
- Cluster policy → IPoIB CNI: configures component
- Cluster policy → NV IPAM: configures component
- Cluster policy → NIC configuration: configures component
- Kubernetes API → Macvlan reconciler: watches network
- Macvlan reconciler → Macvlan state: syncs state
- Kubernetes API → Host-device reconciler: watches network
controllers/hostdevicenetwork_controller.go - Host-device reconciler → Host-device state: syncs state
controllers/hostdevicenetwork_controller.go - Kubernetes API → IPoIB reconciler: watches network
- IPoIB reconciler → IPoIB state: syncs state
- Kubernetes API → Upgrade coordinator: provides policy events
- Drain controller → Drain requestor: creates requestor
controllers/drain_controller.go - Drain controller → Kubernetes API: updates maintenance state
controllers/drain_controller.go - Cluster operator → Kubernetes API: requests node drain