Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support annotation from Discovery handlers and Configuration #639

Open
johnsonshih opened this issue Jul 31, 2023 · 3 comments
Open

Support annotation from Discovery handlers and Configuration #639

johnsonshih opened this issue Jul 31, 2023 · 3 comments

Comments

@johnsonshih
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When Dapr is installed in a Kubernetes cluster, it deploys a special component called the Dapr sidecar injector. This component watches for pods that are annotated with the specific Dapr annotations, and automatically injects the Dapr runtime sidecar into those pods.
https://docs.dapr.io/concepts/dapr-services/sidecar-injector/

You will want Akri to ensure that the proper annotations are present when the broker pod is created so that dapr is automatically injected.

Is your feature request related to a way you would like Akri extended? Please describe.
A clear and concise description of what cool feature Akri lacks. Ex. I'd love Akri to support discovery of Bluetooth devices.

Describe the solution you'd like
A clear and concise description of what you want to happen.

The ContainerAllocateResponse is returned from device plugin in responding of allocate requests. The ContainerAllocateRespone contains information to be set in the associated container, includes: 1) environment variables 2) directories to mount 3) device paths and 4) annotations.

Currently the Device instances returned from Discovery Handlers contains 1) environment variables 2) directories to mount and 3) device paths. The Akri Configuration brokerProperties is used to specify additional environment variables to be set in the container. We should have fields in Discovery Handler Device and Akri Configuration for annotations, too. The fields for annotations should be similar to the fields for environment variables that allows specifying annotation values at per-instance and per-configuration level.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@agracey
Copy link

agracey commented Jul 31, 2023

Could it be simpler to remove the distinction of each type of data and instead return a generic object?

Then you could pass whatever data you want between the handler and the broker template the controller uses to build the workload.

@diconico07
Copy link
Contributor

diconico07 commented Aug 1, 2023

If I understand correctly you want to add annotations to the broker pod/job so that it gets handled by dapr sidecar injector.

But the annotations of ContainerAllocateResponse are CRI level annotations, and are not visible from the Kubernetes API (and will not trigger the sidecar-injector).

You rather need the possibility to fill the metadata.annotations field of the broker pod template (and this is currently impossible as we only specify the spec field in the Configuration). I believe project-akri/akri-docs#75 should solve your issue.

@github-actions
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants