Design Patterns · Study deck

Edge Container Orchestration: Workload Contracts

An orchestrator can restart a service only when its workload contract is clear.

Blueprint Bina is your guide for this deck.

containerorchestration
Blueprint Bina, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain what an orchestrator adds beyond Dockerfiles and container registries.
  • Design a Kubernetes workload contract with images, probes, resources, configuration, secrets, and rollout behavior.
  • Choose between cloud Kubernetes, lightweight edge Kubernetes, KubeEdge, and simpler gateway supervisors.
  • Decide when service mesh is useful for IoT service-to-service traffic.
iotclass.org

Major section

Start With the Workload That Must Keep Running

A new release starts well, then one copy runs out of memory while the site link is down.

  • Restarting it may help, but only if queued events, secret values, and the last safe version survive.
  • Telemetry means readings and status sent by a remote device.
  • The package alone does not define those duties.
iotclass.org

Major section

Start With the Workload That Must Keep Running (continued)

This trial does not settle every scale or platform choice.

  • Sites and failure costs differ.
  • The deeper sections show how health checks, placement, limits, rollout, rollback, and edge independence turn the workload promise into an operating record.
  • The image is only the package; the workload contract decides how it survives.
iotclass.org

Major section

Minimum Viable Understanding

A container image is not a deployment plan.: The image packages a service.

  • Readiness is different from liveness.: A live container can still be unready for traffic while it opens broker connections, warms caches, or waits for a migration.
  • Resource requests and limits are part of the contract.: Without them, one noisy IoT service can starve the gateway, node, or shared cluster.
  • Edge orchestration is an autonomy question.: A cloud cluster, a lightweight edge cluster, and a disconnected gateway have different failure modes.
  • Service mesh is optional infrastructure.: It can add mTLS, routing, and telemetry, but it must earn its resource and operational cost.
iotclass.org

Major section

Orchestration Starts With A Workload Contract

A container image says what to run.

  • A telemetry ingest outage can hide a freezer alarm.
  • A command service rollout can duplicate actuator requests.
  • A gateway update can break local rules while the WAN link is down.
  • The orchestrator is therefore part of the product's safety and support model, not just a server scheduler.
iotclass.org

Major section

Orchestration Starts With A Workload Contract (continued)

The cloud side may run an MQTT bridge, telemetry ingest API, command service, alert worker, and dashboard backend on Kubernetes.

  • The store side may run a gateway container, local rules engine, short-term queue, and device adapter under K3s, Azure IoT Edge, AWS IoT Greengrass, Balena, Docker Compose, or a vendor supervisor.
  • Cloud services often need Deployments, Services, Ingress, HPA, ConfigMaps, Secrets, and observability pipelines.
  • Good orchestration makes those outcomes explicit before the failure happens.
iotclass.org

Major section

Orchestration Starts With A Workload Contract (continued)

Edge gateways may need K3s, KubeEdge, AWS IoT Greengrass, Azure IoT Edge, Balena, Docker Compose, or a simpler supervisor depending on autonomy and support needs.

  • Stateful workloads such as brokers, databases, and local queues need storage, backup, update, and recovery rules beyond a generic Deployment.
  • If a storm of devices reconnects after a power outage, the platform may need to scale workers from broker lag rather than CPU.
  • If a new image starts but cannot reach the broker, readiness should keep it out of the Service endpoint set.
iotclass.org

Major section

Review One Telemetry Ingest Deployment

A liveness probe should detect a stuck process without killing a slow but recovering pod.

  • The important question is whether the platform can keep useful service running during reconnect storms, bad images, slow dependencies, and partial rollouts.
  • A startup probe can give schema checks and warmup time.
  • The capacity review should use measured load, not guesses.
iotclass.org

Major section

Review One Telemetry Ingest Deployment (continued)

A telemetry-ingest service reads MQTT messages from EMQX or Mosquitto, writes normalized readings to PostgreSQL or TimescaleDB, and publishes alerts to Kafka or NATS JetStream.

  • The Deployment should pin an immutable image digest, use a ServiceAccount with only the required permissions, load broker and database credentials from Secrets, and expose separate startup, readiness, and liveness probes.
  • A readiness probe should stay false until the broker connection, write path, and local cache are ready.
  • If a store outage can replay two hours of buffered telemetry, test that replay in staging and watch broker lag, dropped messages, pod restarts, and database write latency.
iotclass.org

Major section

The Control Plane Acts On Signals

A PodDisruptionBudget that allows too many pods down can break alert ingestion during node maintenance.

  • Kubernetes and edge orchestrators do not understand product intent.
  • They act on declared signals: probe results, resource pressure, desired replica counts, node health, taints, labels, Secrets, ConfigMaps, and controller status.
  • The control loop only works when the signals match the workload.
iotclass.org

Major section

The Control Plane Acts On Signals (continued)

Placement: node labels, affinity, tolerations, and PodDisruptionBudgets decide where workloads run and how much voluntary disruption is acceptable.

  • Scaling:: HPA uses CPU, memory, or custom metrics; KEDA can scale workers from Kafka lag, MQTT-adjacent queues, cloud queues, or Prometheus metrics.
  • Rollout:: Deployment strategies, Argo Rollouts, Flagger, Helm, Kustomize, Argo CD, or Flux can automate progressive delivery only when health metrics are reliable.
  • Security:: RBAC, ServiceAccounts, NetworkPolicies, mTLS, image signing, admission policy, and secret rotation protect the cluster without replacing application authorization.
  • A readiness endpoint that only returns "process is running" can make a bad rollout look healthy.
iotclass.org

Major section

The Control Plane Acts On Signals (continued)

Both routes return to a readiness check or an operator review, connecting the chapter's signal inventory to a closed operational loop rather than treating autoscaling as a one-way reaction.

  • The important distinction is between a failed readiness gate, which withholds traffic, and a workload signal, which may justify scaling or pausing a release.
  • At the top of, Device burst or new release reaches: Telemetry ingest Deployment, but: Startup and readiness pass? Decides whether a pod may join: Service endpoints.
  • A NetworkPolicy that blocks the broker can look like an application outage unless the probe and logs identify the missing path.
iotclass.org

Major section

Orchestration Decision Map

The visual connects desired state to running workloads, which is the evidence needed to decide whether a full control plane, a lightweight edge distribution, or a simpler supervisor fits the deployment.

  • The store preserves desired state, the scheduler chooses placement, and controllers correct drift.
Container orchestration control plane and worker nodes
Container orchestration control plane and worker nodes
iotclass.org

Major section

Container Contract

A production container contract tells the platform how to run the service safely.

  • Pin an immutable image tag or digest, build from a minimal base, run as a non-root user, and keep the image free of environment-specific secrets.
  • Declare CPU and memory requests for scheduling, then set limits that protect the node without causing normal bursts to fail.
  • This makes rollout behavior part of the workload contract rather than an optimistic deployment command.
iotclass.org

Deck summary

Key takeaways

A new release starts well, then one copy runs out of memory while the site link is down.

  • This trial does not settle every scale or platform choice.
  • A container image is not a deployment plan.: The image packages a service.
  • A container image says what to run.
  • The cloud side may run an MQTT bridge, telemetry ingest API, command service, alert worker, and dashboard backend on Kubernetes.
iotclass.org

Retrieval practice

Recall check

Blueprint Bina says: answer from memory, then check your reasoning.

Q1A telemetry ingest container is packaged and pushed to a registry. Which launch review best defines how the orchestrator should run it safely?

AReview image digest, secrets, probes, resources, rollout strategy, and rollback metrics
BTreat the Dockerfile as the rollout, scaling, discovery, and rollback record
CSet readiness true so every new pod receives traffic during startup
DScale by changing image tags whenever telemetry traffic increases
Show answer

Answer: A Container orchestration works from declared contracts: image identity, configuration, secrets, probes, resource intent, rollout strategy, and observable rollback signals.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Container orchestration works from declared contracts: image identity, configuration, secrets, probes, resource intent, rollout strategy, and observable rollback signals.
iotclass.org