Connecting IOT Devices to Kubernetes/Openshift

Andrew Stoycos
2 min readFeb 17, 2020

--

The use of IoT devices and cloud computing has exploded in recent years, however it can still be a very difficult endeavor to actually connect your devices to the cloud, and process all the data in a scalable, efficient, and generalized manner.

Despite searching, I was unable to find an opensource end-to-end solution for this, so I decided to build my own using two main technologies, Enmasse and Knative. I wont go in too much detail , but essentially Enmasse enables managed and self servicing messaging on either bare metal or a cloud instance, and its IoT Services enables us to manage and connect multiple protocol devices to back-end applications via a standard AMQP1.0 connection. To enable workloads with all the data from these devices, Knative allows the user to deploy modern serverless workloads on top of Kubernetes. The main motivators for connecting the two was efficiency and flexibility. Much of the time low resource IoT devices may not be sending data back to the cloud and while traditional applications may sit there waiting for data, Knative only spins up kubernetes pods(machines) when data is explicitly sent to the service. Also, all of the previously aforementioned services, Enmasse, Knative, Openshift can be adapted to work with any major cloud company’s infrastructure, eliminating vendor lock in.

In order to create this system I had to write a new data source that could pull AMQP 1.0 messages from the application side of Enmasse and push them to a Knative service via the standard CloudEvent format. Thankfully Knative already had documentation on how to setup a new source for such services, simplifying the process. In a real world use case the stack could function as follows:

The Documentation to setup Enmasse’s IOT services can be found here.

The Documentation to setup Knative can be found here.

My iotContainerSource Repo contains the custom container source for this stack and also contains more information on how to setup a basic use case.

Stay tuned for a full use case demo utilizing this stack.

--

--

Andrew Stoycos

Software Engineer currently working at RedHat based in Boston, Fascinated with cloud technologies and the industry’s push towards Edge computing