project-akri / akri

A Kubernetes Resource Interface for the Edge
https://docs.akri.sh/
Apache License 2.0
1.11k stars 144 forks source link

Allow a customizable service to enrich environment variable after device discovery/before creating broker POD #495

Open leoluKL opened 2 years ago

leoluKL commented 2 years ago

Currently AKRI can not support cases like,

Basically there is no standard and straight forward method to integrate AKRI with solution developer's own device inventory database. This suggestion proposes a new AKRI component that will use customizable container image that will be able to enrich more environment variables for broker POD creation. For example, it can request extra device credential information from a device provisioning service. The below mockup flow diagram shows the proposed new AKRI component using a yellow block.

image

There are other potential usage for this proposed component, for example, it may also decide if the discovered device is a legit device and decide if a broker POD should be allocated to gather data from this device.

bfjelds commented 2 years ago

this sounds pretty cool. would you mind creating a proposal here: https://github.com/project-akri/akri-docs/tree/main/proposals?

leoluKL commented 2 years ago

Yes, I will do that.

I want to modify the previous proposed flow a little bit. Because it right now can handle getting new credential from external device registration inventory before creating broker pod, but it fails to react and recreate broker pod if device credential changes in device registration inventory for discovered devices. I want to change the proposed preparation step to be between Akri agent and the external device registration inventory. So the device information change (such as credential) can be directly reflected in Akri instance change and trigger recreating the broker POD.

github-actions[bot] commented 1 year ago

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

github-actions[bot] commented 1 year ago

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

Tetragramato commented 1 year ago

Hello, maybe you can do this kind of things with a initContainer for the broker, no ?

And this could work 🤔

agracey commented 1 year ago

A mutating admission webhook could be a way to do this as well