Skip to main content
Version: v3.9.0

Control plane module

The internal/controlplane package holds pure conversion logic for local Controller deployments: manifest → runtime microservice model, controller environment variables, port/volume mappings, and DNS FQDN helpers. Reconcile and persistence live in Process Manager, store, and runtimeapi.

Code: internal/controlplane/

Operator guide: Local control plane

Purpose​

  • Build models.Microservice from validated ControlPlaneManifest
  • Define default ports, volume names, container paths
  • Merge capabilities and HTTPS cert bind mounts
  • Supply DNS FQDN lists for bridge registration

Does not run HTTP or containers directly.

Dependencies​

Depends onReason
modelsManifest and microservice types
Used byReason
runtimeapiDeploy apply validates and persists manifest
processmanagerLaunch/recreate CP container from SQLite row
dnsresolverFQDN helpers for CP workload records

Manifest → microservice​

BuildMicroserviceFromControlPlane(doc, controllerUUID, image):

AspectDefault / rule
UUIDGenerated controller UUID (stable in SQLite)
IsControllertrue, IsSystem
Host API port51121 → spec.controller.port (default 51121)
Host console port80 → spec.console.port (default 8008)
Volumesiofog-controller-db, iofog-controller-log
TLSOptional bind mount to /etc/iofog/controller-cert/
RegistryRegistryID = 2 (local default)

Constants in runtime.go: HostAPIPort, HostConsolePort, volume names, container paths.

Environment​

BuildControllerEnv(doc, controllerUUID) produces controller container env (Controller expectations). Called during microservice build.

DNS​

ControlPlaneFQDNs(namespace, name) returns bridge-local names consumed by dnsresolver when CP container is registered (see DNS resolver).

Persistence and reconcile​

LayerResponsibility
store.system_control_planeSingleton deployment row + manifest YAML
runtimeapiAsync apply, validation, operation polling
processmanagerreconcileControlPlane() when that workload is due (spec change, container event, backoff or volume wait, catalog ready or failed, or the about-once-a-minute full compare). See Process manager
processmanager/controlplane_dns.goUpsert/remove DNS workload record

At most one CP deployment per node (SQLite id=1 check).

External APIs​

EdgeletAPIRole
POST /v1/deploy/controlplane:applyStart async apply
GET /v1/deploy/controlplane:apply/{operationId}Poll status
GET /v1/system/controlplaneDeployment status
POST /v1/system/controlplane/restartBounce container; optional ?pull=true
DELETE /v1/system/controlplaneRemove deployment + volumes

Failure modes​

SymptomCause
Reconcile recreates containerRow exists; external docker rm
ms rm rejected on CP UUIDMust use controlplane delete
ms restart rejected when provisionedUse controlplane restart instead
Need image/env changeRedeploy: edgelet deploy -f controlplane.yaml (not restart)
Second apply 409Apply in progress

Code map​

FileRole
runtime.goMicroservice build, env, ports, volumes
env.goController env construction
runtime_test.goConversion tests

Related: Runtime API, Process manager, Store, Local control plane.

Group 3See anything wrong with the document? Help us improve it!