Skip to main content
Version: v1.6.0

Quick Start With Local Deployment

In this guide we will:

  • Install the prerequisites and tools required to create and manage Edge Compute Networks ('ECNs')
  • Create an ECN on a local machine to demonstrate the processes and components involved in an ECN
  • Deploy a set of Microservices on our local ECN

Prerequisites

Install potctl on Mac

Mac users can use Homebrew:

brew tap datasance/potctl
brew install potctl

Install potctl on Windows

The Windows binary can be downloaded from Datasance Packages.

Prepare Windows

In order to use potctl to deploy an ECN locally on Windows we will need to configure Docker to run Linux containers:

Install potctl on Linux

The Debian package can be installed like so:

wget -qO- https://downloads.datasance.com/datasance.gpg | sudo tee /etc/apt/trusted.gpg.d/datasance.gpg >/dev/null
echo "deb [arch=all signed-by=/etc/apt/trusted.gpg.d/datasance.gpg] https://downloads.datasance.com/deb stable main" | sudo tee /etc/apt/sources.list.d/datansance.list >/dev/null
sudo apt update
sudo apt install potctl -y

And similarly, the RPM package can be installed like so:

cd /etc/yum.repos.d ; curl https://downloads.datasance.com/datasance.repo -LO
sudo yum update
sudo yum install potctl -y

Verify potctl Installation

Run potctl version to verify we have successfully installed the CLI.

Prepare your Keycloak Realms for Datasance PoT

We recommened going through the Keycloak Installation Guide before continuing on here.

Deploy PoT Locally

We can use potctl deploy to install and provision ECN components. Here we will deploy a containerized ECN locally.

Want to know more about potctl?

We aren't going into detail about potctl here because we want to show you how simple it can be to get going with PoT. Please make sure to check out the full potctl documentation here.

Go ahead and paste the following commands into the terminal:

echo "---
apiVersion: datasance.com/v3
kind: LocalControlPlane
metadata:
name: ecn
spec:
iofogUser:
name: Quick
surname: Start
email: user@domain.com
password: q1u45ic9kst563art
auth:
url: https://example.com/
realm: realm-name
realmKey: realm-key
ssl: exter
controllerClient: pot-controller
controllerSecret:
viewerClient: ecn-viewer
nats:
enabled: false
controller:
container:
image: ghcr.io/datasance/controller:3.7.0
---
apiVersion: datasance.com/v3
kind: LocalAgent
metadata:
name: local-agent
spec:
container:
image: ghcr.io/datasance/agent:3.7.0
" > /tmp/quick-start.yaml
potctl deploy -f /tmp/quick-start.yaml

After the deployment has successfully completed, we can verify the resources we specified in the YAML file are running on our local machine.

potctl get all

Which should output something similar to:

NAMESPACE
default

CONTROLLER STATUS AGE UPTIME ADDR PORT
local online 22m29s 22m35s 0.0.0.0 51121

AGENT STATUS AGE UPTIME ADDR VERSION
local-agent RUNNING 22m7s 22m7s 150.179.102.91 3.0.0

APPLICATION STATUS MICROSERVICES

MICROSERVICE STATUS AGENT ROUTES VOLUMES PORTS

VOLUME SOURCE DESTINATION PERMISSIONS AGENTS

ROUTE SOURCE MSVC DEST MSVC

NB: The Agent status might say UNKNOWN for up to 30s. It is the time for the agent to report back its liveness to the controller.

The Controller acts as a control plane, it will be our main point of access and communication with our ECN. If we want to find out more about Controller, please read this.

The Agent is the component that is meant to run on our edge devices. Once it has registered itself with a Controller, the Agent will be in charge of actually pulling the microservices images and starting / stopping the microservices on our edge device. If we want to find out more about Agent, please read this.

Those components are all currently running as separate Docker containers on our local machine. We can list the active containers by running:

docker ps

Which should output something similar to:

CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                                          NAMES
71927882293f iofog/router:3.0.1 "/qpid-dispatch/laun…" 15 minutes ago Up 15 minutes 0.0.0.0:5672->5672/tcp, 0.0.0.0:56721-56722->56721-56722/tcp iofog_PJFbk3ZHjX3RkNWxwcRqzDXnKV6mLHmq
8454ca70755b iofog/agent:3.0.0 "sh /start.sh" 15 minutes ago Up 15 minutes iofog-agent
dc7568ad1708 ghcr.io/datasance/controller:3.7.0 "node /usr/local/lib…" 16 minutes ago Up 16 minutes 0.0.0.0:51121->51121/tcp, 0.0.0.0:8008->80/tcp iofog-controller

Teardown

To remove our ECN and any microservices deployed on it, we can run the following command:

potctl delete all

Next Steps

Now that you have seen what PoT is about, you can create a real ECN with remote hosts. Instructions are found here.

We can also try deploying other Microservices on the local ECN. We can find instructions on writing our own Microservice here and a step-by-step tutorial.

Group 3See anything wrong with the document? Help us improve it!