Git Product home page Git Product logo

coding-to-music / iot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from equinix-labs/metal-iot

0.0 1.0 0.0 9.37 MB

An IoT showcase for the power of bare metal compute and Sprint Curiosity 5G Network

Home Page: https://www.packet.com

License: MIT License

HCL 4.60% JavaScript 28.23% Shell 12.99% Dockerfile 1.32% HTML 0.90% CSS 1.41% Python 1.44% PLpgSQL 2.23% TypeScript 39.20% Smarty 7.68%

iot's Introduction

Packet Labs IoT workshop

This workshop deploys compute, storage, networking, and an IoT application to Packet.com.

Conceptual architecture

Diagram:

Conceptual architecture

Private components:

Components exposed with TLS / Ingress or NodePort:

  • Ingress Controller - Traefik v1 (HostPort 80/443)
  • Serverless compute platform - OpenFaaS
  • MQTT Broker - emitter.io (NodePort) - 30080/30443
  • Business intelligence - Metabase (Ingress/TLS)
  • Metrics visualization - Grafana (Ingress/TLS)

Getting started

Before you begin using this repo you will need a Packet account.

Everything else you need to deploy this workshop is available in this repository.

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. If you are working in development, you can skip the domain and TLS steps.

You can register for a domain at Google Domains or Namecheap.com for a few dollars. You can also configure your domain there, after purchase.

1) Clone the repo

git clone https://github.com/packet-labs/iot

2) Create a bare-metal Kubernetes cluster

You will need to install Terraform for this step.

  • Set your Packet API and project ID in a terraform.tfvar file in /k8s.

  • Enter the k8s folder and apply the terraform plan.

  • Find the IP of one of the nodes in the cluster from your Packet dashboard or the state file in /k8s/

Create four DNS A records (replace example.com with your domain):

  • A gateway.example.com - IP
  • A grafana.example.com - IP
  • A metabase.example.com - IP
  • A emitter.example.com - IP

Some commands will be run from your laptop, so make sure you install Kubectl

3) Install Postgres via KubeDB and helm

You will need to install helm for this step.

4) Install OpenFaaS

You will also deploy the schema.sql at this time for drone_position and drone_event.

65 TLS for OpenFaaS

  • Install cert-manager

    k3sup app install cert-manager
  • Install an Ingress record for your OpenFaaS gateway

    k3sup app install openfaas-ingress \
    --domain gateway.example.com \
    --email [email protected] \
    --ingress-class traefik
  • Add TLS for Grafana

    Edit ./openfaas/grafana-ingress.yaml and edit grafana.example.com replacing example.com with your domain.

    Now run:

    kubectl apply -f ./openfaas/grafana-ingress.yaml

6) Add the MQTT Broker (Emitter.io)

7) Add the OpenFaaS MQTT-Connector

The MQTT-Connector is used to trigger functions and services in response to messages generated by the event source. It runs inside the Kubernetes cluster and is private with no ingress.

8) Add Grafana for function/service visualization

Grafana packages a pre-compiled dashboard for OpenFaaS to show metrics like throughput and latency.

9) Send Drone Data

You can now send data to emitter from your drone clients. Use the drone simulator to generate realistic data for use with visualization tools.

iot's People

Contributors

alexellis avatar allspiritseve avatar c0dyhi11 avatar demarius avatar dependabot[bot] avatar edolnx avatar kit-klein avatar vielmetti avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.