Add an embedded device as resource to Kubernetes

8/23/2019

Currently this is more of a theoretical question than a practical problem. I am trying to figure out how extendable Kubernetes really is.

Think about something like an embedded device. This device has constraint resources and its firmware is difficult to upgrade. That's why it is not possible to run any Kubernetes logic on this device. The goal is to use this device, which communicates via IPv4 or IPv6, as a resource within Kubernetes.

A good example would be a k8s service that processes data from the embedded device on demand. But if there is no demand, it is not necessary to do anything with that data.

apiVersion: v1
kind: Pod
metadata:
  name: temperature
  namespace: temperature-example
spec:
  containers:
     - name: aggregate-temperature
       image: 
       resources:
           limits:
              temperature-sensor/v1: "400"
           requests:
              temperature-sensor/v1: "1"

I am aware of the device plugin but I am not sure if it fits my needs.

  • Does it scale to <100k devices?

  • Can it handle devices of the same type with different firmware versions?

  • Is this useful for a lot of different device types (e.g. sensors for temperature, radiation, humidity, light, electricity, ...)

  • Would it be possible to request a specific device e.g. by using its serial number?

  • Could the cluster easily be extended by more device types?

If one of the questions is answered with no, what are the alternatives?

-- user11969098
embedded-resource
kubernetes

1 Answer

8/26/2019

I am not sure if Device plugin registration it the right solution for your case.

Please remember:

Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications. Kubernetes is comprised of a set of independent, composable control processes that continuously drive the current state towards the provided desired state.

Please refer to What Kubernetes is not:

  • Does not limit the types of applications supported.
  • Does not deploy source code and does not build your application.
  • Does not provide application-level services, such as middleware (for example, message buses), data-processing frameworks (for example, Spark), databases (for example, mysql),
  • Does not provide nor mandate a configuration language/system (for example, jsonnet)
  • Does not provide nor adopt any comprehensive machine configuration, maintenance, management, or self-healing systems.

On the other point of view it depends how your application/solution will work and k8s will be able to keep your solution working in independet way from the Load,requests,responses between your coreapp/users and underlying devices providing necessary information.

In addition please take a look for cloud provider solution:

There are also other different project which extends Kubernetes to provide a set of middleware components like:

Hope this help. If it's not suitable please start collaborate more deeply.

-- Hanx
Source: StackOverflow