IoT Edge Computing / Kubernetes

Microsoft Akri Brings Kubernetes to Tiny Edge ‘Leaf’ Devices

21 Oct 2020 1:15pm, by

This week, Microsoft released a new open source project, Akri, that allows the use of Kubernetes on the edge by exposing leaf devices, such as the sensors, cameras, controllers, and microcontroller unit (MCU) class devices that produce data and perform actions at the edge.

While projects like K3S are intended to provide fully-functional Kubernetes instances to edge devices, Akri targets even smaller devices, which are unable to run Kubernetes themselves. Instead, Akri provides an abstraction layer similar to the Container Network Interface (CNI) that simplifies the process of detecting leaf devices, communicating with them, and scheduling workloads.

“If a solution architect wants to expose these types of devices into a Kubernetes cluster today, they would need to provide very specific configurations for each of the devices. A developer who is targeting this problem can also write bespoke solutions to detect and use each of the devices,” wrote Jiri Appl, principal software engineer at Microsoft in an email. “Overall, neither of these two scenarios are very scalable or manageable, and on top of that, scaling the device data across multiple nodes becomes an even greater problem. We wanted to make a solution that makes using these devices simpler and creating more reusability so that developers can leverage each other’s talents.”

In its blog post unveiling Akri, Microsoft summarizes the project’s purpose simply: “you name it, Akri finds it, you use it.” To do this, you tell Akri what type of device to detect and the discovery protocol needed to do so, then Akri deploys an agent on each node that can discover that specific type of leaf device and exposes those devices to Kubernetes clusters as extended resources. Akri also groups devices according to device class and specific instance, so that you might target a whole class of devices or a specific device if needed. From there, Akri monitors the device’s availability, scheduling workloads accordingly.

“Akri makes it easy to add sensors, controllers, and other small devices to a Kubernetes cluster. With Akri, you don’t have to worry about which node the devices are connected to. Akri automatically deploys a broker pod that knows how to handle the device and you add your own custom code on top to do whatever you want,” writes Appl. “Just as Kubernetes makes scaling the size of your compute easier, Akri makes scaling the number of devices you have on the edge easier. You can add more devices and Akri will automatically discover them and utilize them.”

At launch, Akri supports the Open Network Video Interface Forum (ONVIF) for internet protocol cameras and udev for devices connected directly to the Kubernetes nodes, but more discovery protocols, such as bluetooth and OPC UA, are currently planned. Moreso, the project touts its extensibility, with the hopes that users will aid in the effort. While Akri itself is written in Rust, Appl notes that the workloads deployed to discovered devices can be written in any language.

“It’s day one for Akri – we’re excited to start building the Akri community, get feedback and input from developers, and grow and evolve the project. We are currently looking at bringing support for OPC UA discovery for industrial environments and have other ideas in mind as part of our proposals. We want to hear from community how they are planning to leverage Akri and what features are missing so that Akri can be useful to everybody,” writes Appl, urging users to join the Akri Slack channel.

As a bit of an aside, Akri follows Kubernetes’ naming tradition, taking its name from the Greek word for “edge,” although Microsoft also points to its double use as an acronym for “A Kubernetes Resource Interface for the edge.”