mimik Developer Documentation

Understanding the edgeEngine Service Mesh

Purpose

The purpose of this document is to explain at a conceptual level what the edgeEngine Service Mesh is and what it does.

Intended Readers

The intended readers of this document are software developers, system engineers, application architects, deployment personnel and other technical professionals who want to understand the details of working with edgeEngine Service Mesh.

What You Will Learn from this Document

After reading this document you will:

  • Understand the purpose of the edgeEngine Service Mesh
  • Understand the features of the edgeEngine Service Mesh
  • Understand the concept of an Ad Hoc Service Mesh
  • Understand how to use the edgeEngine Service Mesh to discover a network cluster
  • Understand how to use the edgeEngine Service Mesh to discover a user account cluster
  • Understand how to use the edgeEngine Service Mesh to discover a proximity cluster
  • Understand how to use the edgeEngine Service Mesh to do connection management between edgeEngine microservices

What You Need to Know Before You Start

In order to get full benefit from reading this document, you need to have:

  • An understanding of microservice based distributed computing
  • A general understanding about the purpose and nature of a service mesh
  • An understanding the edgeEngine Runtime and how it supports microservices

Understanding the edgeEngine Service Mesh

The edgeEngine Service Mesh is a technology that unifies the microservices running on various nodes of a hybrid edge cloud powered by edgeEngine. The edgeEngine Service Mesh makes it so that any microservice running the edgeEngine Runtime can discover the details of the other nodes running within an hybrid edge cloud. Also, the edgeEngine Service Mesh has the capability of managing direct connections between other edgeEngine nodes inside and outside the local network.

Executing Service Discovery Using the edgeEngine Service Mesh

Developers work with mimik Discovery Service API to discover the nodes running within an hybrid edge cloud according to the cluster type, Network, Account or Proximity. Segmenting clusters according to type is feature called the Ad Hoc Service Mesh.

The details of the Ad Hoc Service Mesh are discussed in the sections that follow.

Working with the Ad Hoc Service Mesh

The edgeEngine ecosystem has a concept called the Ad Hoc Service Mesh. The Ad Hoc Service Mesh makes it so that a node can be belong to three types of clusters. The cluster types are called *Network, Account and Proximity.

The edgeEngine Service Mesh
Figure 1: The edgeEngine Service Mesh groups nodes according to 3 types of clusters

A Network cluster is made nodes that are part of the same network. An Account cluster is made up nodes that are part of the same User Account. A Proximity cluster is made of nodes that are close to one another in terms of physical geo-location.

The details of each cluster type is discussed in the sections that follow.

Identifying a Network Cluster

The way a developer discovers nodes that are part of a Network cluster is to write custom code that makes the following call to the mimik Discovery Service (mDS) API according to this URL structure:

http://127.0.0.1:8083/mds/v1/nodes?clusters=linkLocal

Making this call assumes that the custom code is running on a device that is also running the edgeEngine Runtime.

However, just making the call is not enough. Access to the mimik Discovery Service API is granted according to the presence of an edgeEngine Access Token attached to the request header using Bearer Authentication. The details of edgeEngine Access Tokens are discussed in the Key Concepts section, Understanding edgeEngine Tokens.) Also, data passed from a edgeEngine microservice is encrypted. Thus, the information must be decoded. Listing 1 below shows an example of Node.JS that a developer can use to discover all the edgeEngine nodes running in a hybrid edge cloud.

app.get('/localDevices', (request, response) => {
context.http.request(({
url: 'http://127.0.0.1:8083/mds/v1/nodes?clusters=linkLocal',
success: function(r) {
if (!request.authorization) {
response.status = 403;
response.end(JSON.stringify({ 'msg': 'missing bearer token' }, 2, null));
return;
}
const authorization = request.authorization.split(' ');
if (authorization.length < 2) {
response.status = 403;
response.end(JSON.stringify({ 'msg': 'missing bearer token' }, 2, null));
return;
}
const token = authorization[1];
const nodes = JSON.parse(r.data);
const data = JSON.stringify(nodes.data);
context.edge.decryptEncryptedNodesJson({
type: 'local',
data,
token,
success: function(result) { // success option
response.end(JSON.stringify(JSON.parse(result.data), null, 2));
},
error: function(err) {
response.end(err.message);
}
});
},
error: function(err) {
response.end(err.message);
}
}));
});

Listing 1: The Node.JS code for making a call to the edgeEngine Service Mesh to discover nodes in a Network Cluster

[MORE TO COME]

Identifying a Account Cluster

[TO BE PROVIDED]

Identifying an Proximity Cluster

[TO BE PROVIDED]

Managing Connections between microservices using the edgeEngine Service Mesh

[TO BE PROVIDED]