Kubernetes on ESP32-S3 with WebAssembly Pod Runtime
The kube32 project implements a Kubernetes-compatible control plane and WebAssembly pod runtime for ESP32-S3 microcontrollers, supporting API objects, familiar tools, and resource-constrained environments.
Kubernetes Compatibility and Control Plane Implementation
The kube32 project presents a Kubernetes-compatible control plane and WebAssembly pod runtime tailored for ESP32-S3 microcontrollers. It supports a wide range of Kubernetes API objects, including Pod, Node, Namespace, Service, Deployment, and more, enabling developers to interact with the system using familiar tools like kubectl and k9s. The implementation includes features such as watch streams, Table output, OpenAPI v3 validation, and log tailing, as noted in the project's documentation. Additionally, kube32 provides a multi-node host simulator (kube32-sim) and a command-line interface (kube32-cli) for building, checking, and deploying pods over the network or to node storage. These tools facilitate development and testing without requiring physical hardware, making the project a promising exploration of Kubernetes principles applied to resource-constrained environments.
WebAssembly Pod Runtime and SDK Support
The WebAssembly Pod Runtime and SDK Support section highlights the integration of WebAssembly pods within the wasm3 framework, offering SDKs and templates for Rust, C, and AssemblyScript. Developers can choose between a request-handler ABI using k32_handle or an entry-point ABI using app_main, with configurable memory limits and per-call gas budgets. This enables efficient resource management and execution on constrained hardware.
- Service routing, HTTP Ingress with host and prefix rules, and Server-Sent Events streams are supported, enhancing the microcontroller's ability to handle complex networking tasks.
- Embedded static asset bundles via
k32_resp_assetandStaticBundleallow for efficient deployment of assets directly within the runtime. - Synchronous pod-to-pod HTTP calls via
k32_http_callfacilitate communication between microcontroller-based services.
Hardware and Peripheral Access Management
In the Hardware and Peripheral Access Management section of the project, the system implements a capability firewall that gates peripheral access per pod. This firewall controls access to critical hardware components such as GPIO pins, ADC channels, I2C and UART buses, the ST7789 display, key matrix, I2S speaker, and microSD storage. The Cardputer worker runs tessera-db and tessera-hud, which persist records to an append-only log on the microSD card and manage the LCD and keypad. Notably, tessera-hud is silent by default, with sound enabled only when the HUD_SOUND=1 environment variable is set and the speaker capability is granted. Firmware updates are rolled out one node at a time, with each image verified using SHA-256 hashing. If an image fails to initialize properly, the system initiates a bootloader rollback to restore functionality.
Storage and Persistent Object Management
The storage and persistent object management in this Kubernetes rebuild for ESP32 microcontrollers relies on a CRC-checked journal stored on a raw flash partition or microSD card. This approach ensures data integrity and reliability in resource-constrained environments. PersistentVolumeClaim (PVC) pod volumes are supported through k32_fs_* tools, enabling persistent storage for applications. Rotated container logs are also available for use with kubectl logs --previous, facilitating debugging and auditing. To deploy and test this system, users can generate a sample dataset, upload it to a worker's microSD card, and apply Kubernetes manifests using provided CLI tools. The system also supports pub/sub events via k32_event_emit and kube32.io/event-topics, which are bridged across nodes using ESP-NOW and UDP port 7400 for real-time communication.
Documentation and Licensing Information
Documentation for the Kubernetes implementation on ESP32 microcontrollers is available at https://arterialist.github.io/kube32/. The documentation covers key areas such as flashing and serial console setup, writing app pods, cluster access and authentication, services and Ingress, pod-to-pod communication, storage and volumes, peripherals, architecture overview, Kubernetes API coverage, CLI and tools reference, and contributing guidelines. Contributions are welcomed by the project maintainers. The third-party component wasm3 used in the project is licensed under the MIT License, as stated in the third_party/wasm3/LICENSE file.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.