Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomkerkhove/iot-with-dapr-actors
Example of how you can build IoT solutions that have custom device gateways that are using Dapr Actors to represent devices in the field.
https://github.com/tomkerkhove/iot-with-dapr-actors
azure azure-iot dapr hacktoberfest
Last synced: 3 months ago
JSON representation
Example of how you can build IoT solutions that have custom device gateways that are using Dapr Actors to represent devices in the field.
- Host: GitHub
- URL: https://github.com/tomkerkhove/iot-with-dapr-actors
- Owner: tomkerkhove
- License: mit
- Created: 2020-07-30T11:28:38.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T05:14:20.000Z (about 1 year ago)
- Last Synced: 2024-10-06T14:23:49.232Z (4 months ago)
- Topics: azure, azure-iot, dapr, hacktoberfest
- Language: C#
- Homepage:
- Size: 660 KB
- Stars: 29
- Watchers: 5
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Building IoT solutions with Dapr Actors
Example of how you can build IoT solutions that have custom device gateways that are using Dapr Actors to represent devices in the field.
## How does it work?
![Overview](./media/overview.png)
## Try it yourself!
### Kubernetes
#### Prerequisites
Before you can start, you'll need to :
1. Install Dapr ([docs](https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-deploy/#install-with-helm-advanced))
2. Install KEDA ([docs](https://keda.sh/docs/latest/deploy/#helm))
3. Update YAML specs under `/deploy` with your config#### Deploying the scenario
You are ready to go, deploy!
1. Deploy Dapr Components
```shell
$ k apply -f .\deploy\dapr-infrastructure.yaml
secret/dapr-infrastructure-secrets created
component.dapr.io/dapr-state-store created
```2. Deploy Device Actor Host
```shell
$ k apply -f .\deploy\device-actors.yaml
secret/dapr-sandbox-actors-secrets created
deployment.apps/dapr-sandbox-actors created
```3. Deploy Device API
```shell
$ k apply -f .\deploy\device-api.yaml
secret/dapr-sandbox-apis-device-secrets created
deployment.apps/dapr-sandbox-apis-device created
service/dapr-sandbox-apis-device-service created
service/dapr-sandbox-apis-device-load-balancer created
```4. Deploy Twin Change Stream Processor
```shell
$ k apply -f .\deploy\twin-changes-stream-processor.yaml
secret/dapr-sandbox-twin-change-secrets unchanged
deployment.apps/twin-changes-stream-processor created
scaledobject.keda.k8s.io/twin-changes-autoscale created
```5. Deploy Device Message Stream Processor
```shell
$ k apply -f .\deploy\device-message-stream-processor.yaml
secret/dapr-sandbox-device-telemetry-secrets created
deployment.apps/device-telemetry-stream-processor created
scaledobject.keda.k8s.io/device-telemetry-autoscale created
```### Locally
1. Configure dependencies in `docker-compose.override.yml`
2. Start containers with Docker Compose:```shell
$ cd src
$ docker-compose up
```3. Explore the API on http://localhost:880/api/docs
#### Cleanup
Stop containers with Docker Compose:
```shell
$ docker-compose down
```### Testing
#### Sending device messages
Messages should be sent as following to Azure Event Hubs:
```raw
messageType: Telemetry
deviceId:
{
"content": "Hello Dapr!"
}
```