Overview
sonic-operator is a Kubernetes-native, declarative operator for onboarding and managing the lifecycle of bare-metal network switches.
Architecture
- Controller manager runs in the cluster, reconciles CRDs, and maintains status.
- Switch agent runs on the switch and exposes device/port/interface operations via gRPC.
- Provisioning server serves ZTP scripts and ONIE installer artifacts over HTTP.
Reconciliation flow
- A
SwitchCR is created to represent a physical switch and its management endpoint. - The controller connects to the switch agent and observes device state.
- The controller creates/updates
SwitchInterfaceCRs based on discovered interfaces. - Interface admin state in
SwitchInterface.specis enforced on the device. - Status fields are updated on
Switch,SwitchInterfacebased on observed state.
Provisioning flow
- ZTP scripts are rendered from templates and served at
GET /ztp. - ONIE installers are served from a configured directory at HTTP root (
/). - The provisioning server can run embedded in the manager or as a standalone binary.