This microservice simulates geographically distributed IoT devices. This service simulates the creation, state, and deletion of IoT devices.
Via the map UI provided by the woe-twin microservice, requests to create and delete IoT devices or requests to change the state of existing devices are processed by this microservice. These processed requests are then sent as simulated device telemetry messages to the woe-twin microservice.
Follow these instructions for installing and running the woe-sim microservice.
First, clone the weo-sim Github project.
git clone https://github.com/mckeeh3/woe-sim.git
See Setup Kubernetes for instructions on setting up a Kubernetes cluster in various environments.
The namespace only needs to be created once.
kubectl create namespace woe-sim
namespace/woe-sim created
Set this namespace as the default for subsequent kubectl
commands.
kubectl config set-context --current --namespace=woe-sim
Context "kind-kind" modified.
See Setup a database for instructions on setting up a Cassandra or PostgreSQL database in various environments.
See Setup a container registry for instructions on setting up a Docker image registry.
From the woe-sim project directory.
Build the project, which will create a new Docker image.
mvn clean package docker:push
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.566 s
[INFO] Finished at: 2021-05-22T14:59:56-04:00
[INFO] ------------------------------------------------------------------------
Select the deployment file for the database environment that you are using.
For Cassandra deployed to the Kubernetes cluster using helm.
kubectl apply -f kubernetes/woe-sim-helm-cassandra.yml
For PostgreSQL deployed to the Kubernetes cluster using helm.
kubectl apply -f kubernetes/woe-sim-helm-postgresql.yml
deployment.apps/woe-sim created
role.rbac.authorization.k8s.io/pod-reader created
rolebinding.rbac.authorization.k8s.io/read-pods created
This may take a few moments.
kubectl get pods
NAME READY STATUS RESTARTS AGE
woe-sim-77dfcc864b-6cvrg 1/1 Running 0 3h10m
woe-sim-77dfcc864b-trmz7 1/1 Running 0 3h10m
woe-sim-77dfcc864b-vf78s 1/1 Running 0 3h10m
See Setup a load balancer for instructions on setting up a Kubernetes load balancer in various environments.
Next, deploy the woe-twin microservice.
TODO