How mellanox/spectrum-x-operator works
The NVIDIA Spectrum-X Operator runs in Kubernetes and coordinates node-level Spectrum-X networking. Its workflow watches Pod network state and programs OVS rail flows, while a separate SpectrumXRailPoolConfig reconciliation path applies node policies and tracks synchronization. Background components clean stale flows and mirror PF carrier state to VF representors; startup also installs OVS safe-start configuration. The main entry point and core controller imports are indexed, but several setup calls and subsystems are unsampled, so only documented or indexed relationships are connected.
Main entry points: spectrumxrailpoolconfig_host_flows_controller.go Rail config reconciler · main.go Controller manager · monitor.go VF carrier follower · flows.go Rail flow programming
Components 16
Operator runtime
- Controller manager
cmd/flowscontroller/main.go
Pod rail flows
- Pod flow reconciler
internal/controller/flow_controller.go - Rail flow programming
internal/controller/flows.go - Stale flow cleanup
internal/staleflows/stalecleanup.go
Rail configuration
- Rail config reconciler
internal/controller/spectrumxrailpoolconfig_host_flows_controller.go - Rail config API
api/v1alpha2/spectrumxrailpoolconfig_types.go - Node state lookup
pkg/state/state.go
Node networking
- Command execution
pkg/exec/exec.go - Netlink operations
pkg/lib/netlink/netlink.go - VF carrier follower
internal/vfstatefollower/monitor.go - OVS safe-start installer
internal/ovssafestart/install.go - Runtime configuration
pkg/config/config.go
Other components
- Kubernetes API
- Open vSwitch
- Host network devices
- SR-IOV resources
Connections 18
- Controller manager → Pod flow reconciler: starts controller
cmd/flowscontroller/main.go - Controller manager → Rail config reconciler: starts controller
cmd/flowscontroller/main.go - Controller manager → Stale flow cleanup: starts cleanup
cmd/flowscontroller/main.go - Controller manager → VF carrier follower: starts follower
cmd/flowscontroller/main.go - Pod flow reconciler → Rail flow programming: adds or deletes
internal/controller/flow_controller.go - Pod flow reconciler → Command execution: queries OVS
internal/controller/flow_controller.go - Rail flow programming → Command execution: runs commands
internal/controller/flows.go - Rail flow programming → Open vSwitch: programs flows
internal/controller/flows.go - Stale flow cleanup → Rail flow programming: cleans stale flows
internal/staleflows/stalecleanup.go - Rail config reconciler → Rail config API: reconciles resource
internal/controller/spectrumxrailpoolconfig_host_flows_controller.go - Rail config reconciler → Node state lookup: looks up state
internal/controller/spectrumxrailpoolconfig_host_flows_controller.go - Rail config reconciler → SR-IOV resources: patches policies
internal/controller/spectrumxrailpoolconfig_host_flows_controller.go - Rail config reconciler → Open vSwitch: manages OVS resources
internal/controller/spectrumxrailpoolconfig_host_flows_controller.go - Controller manager → Kubernetes API: runs manager
cmd/flowscontroller/main.go - VF carrier follower → Rail config API: reads configs
internal/vfstatefollower/monitor.go - VF carrier follower → Netlink operations: checks and sets links
internal/vfstatefollower/monitor.go - VF carrier follower → Host network devices: tracks carrier
internal/vfstatefollower/monitor.go - Rail config reconciler → OVS safe-start installer: uses installer
internal/controller/spectrumxrailpoolconfig_host_flows_controller.go