How rancher/elemental-operator works
Elemental Operator manages OS provisioning and lifecycle for machines joining Rancher-managed Kubernetes. The principal flow is a live-ISO machine running elemental-register, which exchanges registration data with the operator; the operator records machine inventory and reconciles provisioning plans. Separate operator capabilities select/adopt inventories, build seed images, and manage OS images and version channels. The graph distinguishes those domain controllers from the internal registration client/server and installation layer. Several controller interactions are documented only at product level or were not excerpted, so those links are dashed and unverified.
Main entry points: root.go Operator setup · main.go Register command · server.go Inventory HTTP server · machineinventory_controller.go Inventory reconciliation
Components 20
Entry points
- Operator command
cmd/operator/main.go - Register command
cmd/register/main.go - Support collection
cmd/support/main.go
Machine registration
- Registration client
pkg/register/register.go - Inventory HTTP server
pkg/server/server.go - Registration API
pkg/server/api_registration.go
Machine lifecycle
- Inventory reconciliation
controllers/machineinventory_controller.go - Registration reconciliation
controllers/machineregistration_controller.go - Inventory selection
controllers/machineselector_controller.go
OS management
- Seed image builds
controllers/seedimage_controller.go - Managed OS images
controllers/managedosimage_controller.go - Managed OS versions
controllers/managedosversion_controller.go - Version channel sync
controllers/managedosversionchannel_controller.go
Provisioning internals
- Kubernetes API types
api/v1beta1/zz_generated.deepcopy.go - Operator setup
cmd/operator/operator/root.go - Kubernetes clients
pkg/clients/clients.go - OS installer
pkg/install/install.go - Host information
pkg/hostinfo/hostinfo.go - System agent interface
internal/system-agent/api.go
Other components
- Booting machine
Connections 22
- Operator command → Operator setup: dispatches
cmd/operator/main.go - Register command → Registration client: registers with
cmd/register/main.go - Booting machine → Register command: runs
- Registration client → Inventory HTTP server: connects by WebSocket
- Inventory HTTP server → Registration API: routes requests
pkg/server/server.go - Inventory HTTP server → Inventory reconciliation: creates inventory
pkg/server/server.go - Operator setup → Kubernetes clients: creates clients
- Operator setup → Inventory reconciliation: registers controller
- Operator setup → Registration reconciliation: registers controller
- Operator setup → Inventory selection: registers controller
- Operator setup → Seed image builds: registers controller
- Operator setup → Managed OS images: registers controller
- Operator setup → Managed OS versions: registers controller
- Operator setup → Version channel sync: registers controller
- Register command → OS installer: installs OS
- Register command → Kubernetes API types: loads configuration types
- Registration API → Host information: reads host data
- Inventory reconciliation → System agent interface: uses plans
controllers/machineinventory_controller.go - Seed image builds → Registration reconciliation: references registration
controllers/seedimage_controller.go - Version channel sync → Managed OS versions: creates versions
controllers/managedosversionchannel_controller.go - Support collection → System agent interface: collects diagnostics
- Operator setup → Kubernetes API types: uses resource types
cmd/operator/operator/root.go