{"id":20059407,"url":"https://github.com/equinix-labs/metal-iot","last_synced_at":"2025-05-05T15:31:28.649Z","repository":{"id":39004892,"uuid":"225961195","full_name":"equinix-labs/metal-iot","owner":"equinix-labs","description":"An IoT showcase for the power of bare metal compute and Sprint Curiosity 5G Network","archived":false,"fork":false,"pushed_at":"2023-12-15T20:22:28.000Z","size":16023,"stargazers_count":86,"open_issues_count":34,"forks_count":14,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-04-24T15:09:26.483Z","etag":null,"topics":["emitter","iot","metabase","mqtt-broker","mqtt-connector","openfaas","packet","sprint"],"latest_commit_sha":null,"homepage":"https://deploy.equinix.com/labs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/equinix-labs.png","metadata":{"files":{"readme":"README.installer.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-04T21:34:14.000Z","updated_at":"2024-03-07T01:50:52.000Z","dependencies_parsed_at":"2023-12-15T22:00:04.514Z","dependency_job_id":null,"html_url":"https://github.com/equinix-labs/metal-iot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinix-labs%2Fmetal-iot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinix-labs%2Fmetal-iot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinix-labs%2Fmetal-iot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equinix-labs%2Fmetal-iot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/equinix-labs","download_url":"https://codeload.github.com/equinix-labs/metal-iot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224452826,"owners_count":17313668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emitter","iot","metabase","mqtt-broker","mqtt-connector","openfaas","packet","sprint"],"created_at":"2024-11-13T13:07:22.000Z","updated_at":"2024-11-13T13:07:22.719Z","avatar_url":"https://github.com/equinix-labs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Equinix Labs IoT workshop\n\nThis workshop deploys compute, storage, networking, and an IoT application to metal.equinix.com.\n\n## Conceptual architecture\n\nDiagram:\n\n![Conceptual architecture](/docs/images/conceptual.png)\n\nPrivate components:\n\n* Kubernetes - provisioned with [Terraform](https://www.terraform.io)\n* TLS termination - via [cert-manager](https://cert-manager.io)\n* MQTT Connector - [openfaas-incubator/mqtt-connector](https://github.com/openfaas-incubator/mqtt-connector)\n* Database/storage - [Postgresql](https://www.postgresql.org)\n* Docker registry - deployed externally, i.e. the Docker Hub.\n\nComponents exposed with TLS / Ingress or NodePort:\n\n* Ingress Controller - [Traefik v1](https://github.com/containous/traefik) (HostPort 80/443)\n* Serverless compute platform - [OpenFaaS](https://github.com/openfaas/faas)\n* MQTT Broker - [emitter.io](https://emitter.io) (NodePort) - 30080/30443\n* Business intelligence - [Metabase](https://www.metabase.com) (Ingress/TLS)\n* Metrics visualization - [Grafana](https://grafana.com) (Ingress/TLS)\n\n## Getting started\n\nBefore you begin using this repo you will need an [Equinix Metal](https://console.equinix.com) account.\n\nEverything else you need to deploy this workshop is available in this repository.\n\n\u003e Note: This repository is designed to be used with your own domain name and a number of DNS records. This enables TLS termination (HTTPS) to be used for exposed services.\n\n\u003e You can register for a domain at [Google Domains](https://domains.google) or [Namecheap.com](https://namecheap.com) for a few dollars. You can also configure your domain there, after purchase.\n\n### 1) Clone the repo\n\n```sh\ngit clone https://github.com/equinix-labs/metal-iot\n```\n\n### 2) Create a bare-metal Kubernetes cluster and deploy the application\n\nYou will use [Terraform](https://www.terraform.io) to [create the cluster and deploy components](/k8s/).\n\nOnce deployed find the IP for one of the cluster nodes in terraform console output, your Equinix Metal dashboard or the `.tfstate` file in /k8s/. Create a wildcard DNS A record using this IP (replace `example.com` with your domain):\n\n* `A *.example.com - \u003cIP\u003e`\n\n### 3) Generate Drone Data\n\nYou can now send data to emitter from drone clients.  A [drone simulator](/test/client/) is included to generate realistic client data for use with visualization tools.  Be sure to configure the environment variables as decribed in the README.md - this will require `kubectl` to be properly configured from step 2.\n\n### 4) Visualize the Drones in Realtime\n\nA [MapBox](https://www.mapbox.com/) based web app is hosted in an OpenFAAS service and can be accessed via `gateway.\u003cyour domain\u003e/function/render-map`.  It provides realtime information on the drone clients location and status.\n\n![](/docs/images/map-render.png)\n\n### 4) Visualize the Metrics\n\nA [Grafana](https://grafana.com/) instance is included to monitor OpenFAAS performance and can be accesed at `grafana.\u003cyour domain\u003e`.  The default login is username: `admin`, password: `admin`.\n\n![](/docs/images/grafana.png)\n\nA [Metabase](https://www.metabase.com/) instance is also hosted in the cluster at `metabase.\u003cyour domain\u003e`.  When you first access Metabase you'll need to configure the instance to connect to the postgres DB.\n\nThe default config parameters are listed below.  Use kubectl to obtain the database password.\n\n```sh\nkubectl get secret --namespace default postgresql -o jsonpath=\"{.data.postgresql-password}\" | base64 --decode\n```\n\n* Type of Database: `PostgreSQL`\n* Name: `Drone Data`\n* Host: `postgresql.default.svc.cluster.local`\n* Port: `5432`\n* Database name: `postgres`\n* Database username: `postgres`\n* Database password: `\u003cpassword obtained from kubectl\u003e`\n\nOnce connected to the database you can visualize the drone_event and drone_position tables.  The first image below shows the locations corresponding to each drone position update - note the drones are clustered in the delivery region surrounding a warehouse.  The second image shows the rate of battery consumption compared to the package payload size - note the abnormal battery to payload ratio for drones 0, 10, and 20 whic indicates the drones are running inefficiently compared to their peers.\n\n![](/docs/images/metabase.png)\n![](/docs/images/metabase2.png)\n\n\n## Modifying the Project\nThis project is organized with each component having it's own self documented folder.  Feel free to explore how each is tied back to the [deploy script](/k8s/install). A few key components are:\n\n* The [OpenFaaS services](/openfaas/services/) for processing events, storing data, and interfacing with drones.\n\n* The [postgres](/postgresql/) database and [schema](/openfaas/services/schema.sql) \n\n* The [MQTT broker](/emitter/)\n\n* The [Drone Monitor Service](/test/controller/)\n\n\u003e\u003e Note that the README in most components assumes you have already created a Kubernetes cluster along with installing and configuring `kubectl` on your PC.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequinix-labs%2Fmetal-iot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fequinix-labs%2Fmetal-iot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequinix-labs%2Fmetal-iot/lists"}