Say Hello to Akri

Edrick Wong
Akri
Published in
4 min readOct 20, 2020

As the IoT space explodes, the solutions that people are building on the edge increase in ability and complexity. Running workloads on the edge can be complex; however, Kubernetes helps developers orchestrate and manage their workloads. Especially for those who are familiar with Kubernetes, being able to create applications for the edge with their existing knowledge is great.

One of the differences between Kubernetes in the cloud and Kubernetes on the edge is that on the edge, workloads target a variety of physical devices, like sensors, cameras, and other leaf devices. As a team focused on the edge, we wanted to make it easier for Kubernetes workloads to utilize these devices. Looking at how we could do this, we made two observations:

  1. These leaf devices tend to have a fixed purpose rather than be used as general compute.
  2. They don’t have the extra capacity to run Kubernetes directly on them.

With these two insights, we realized that there was a Kubernetes concept that could abstract this idea: Kubernetes Resources. If we treated leaf devices as resources instead of compute nodes, we could incorporate devices into Kubernetes applications without putting any overhead onto the devices themselves. Wouldn’t it be cool if we could attach a sensor to a Kubernetes cluster, it’s automatically discovered, and the data is highly available to workloads on any node? We went along with this idea and the result was Akri.

You name it, Akri finds it, You use it

We are excited to introduce Akri, an open source project that defines a Kubernetes based approach on representing leaf devices on the edge as native Kubernetes Resources. Akri, meaning “edge” in Greek, can also be read as an acronym, as Akri aims to be “A Kubernetes Resource Interface for the edge”. It provides an abstraction layer like the Container Networking Interface, but instead of abstracting the underlying network details, it removes the work of finding, utilizing, and monitoring the availability of leaf devices.

There are three things we want to achieve with Akri:

  1. First, we wanted to discover and expose leaf devices to Kubernetes in a simple way. Enabling devices as resources makes the Kubernetes world come alive with new possibilities and lets the developers reuse their Kubernetes knowledge.
  2. We also wanted to make a framework so new protocols for discovering leaf devices could continually be added with the ability to handle the dynamic appearance and disappearance of these devices. Being able to handle the dynamic appearance and disappearance of devices was also a priority.
  3. Lastly, we wanted to create an ecosystem of brokers that know how to communicate with and use the devices. The extensibility of the framework lets anyone make their device solutions a reality.

Conceptually, there are three steps to get your leaf devices up and running.

  1. You name it. You tell Akri what kind of leaf device it should look for in the Akri Configuration.
  2. Akri finds it. The Akri Agent looks for leaf devices and checks on the availability of the ones you want. When the Akri Agent finds one, it creates an Akri Instance which represents it.
  3. You use it. The Akri Controller helps you use the leaf devices. It sees each of the Akri Instances and deploys a “broker” pod that knows how to connect to and use the device.

Use Case

Meadow F7 Micro connected to a Custom PCB plant monitor — Unsplash

To illustrate how Akri works in the field, imagine a farmer where there are sensors and cameras that monitor the field conditions. The farm proves to be a success and plans to expand their acreage. With Akri, the additional sensors can be plugged into the Kubernetes cluster and cameras can be attached to the network and they’re both automatically detected. Broker pods are automatically deployed, and the data from the sensors and video feed from the cameras can be used by the application.

Get started with Akri

The great thing about Akri is that it is extensible, so you can make it work for your scenarios and leaf devices.

For device builders, implementing your device protocols in Akri will allow your devices to work seamlessly with Kubernetes and allow users to easily integrate your devices.

For solution architects who are designing solutions, Akri lets you create workloads that are flexible and can adapt to different scenarios.

For developers, Akri lets you focus on what you are good at: developing. Particularly those who are familiar with cloud-native development, Akri should feel right at home for you.

For a deeper look at the architecture of Akri, check out our technical blog. You can also jump into Akri with the end-to-end demo, which discovers mock cameras and deploys an application that shows the feed of the cameras. You can plug in a physical camera and the application will use those as well!

This project elevates the power of Kubernetes on the edge and is intended to be upstream open source in the Kubernetes ecosystem. With your input and help, we can get there. Is there a device you want to use that Akri doesn’t have a discovery protocol for? Join us on Slack, create an issue on GitHub, or implement the new discovery protocol with the Akri community. We’re excited to continue to refine and extend Akri so that everyone can benefit from this project.

We are eager to see what you discover with this project and how it evolves. Together, we can build a more connected edge with Kubernetes.

--

--