Skip to content

Advanced-Observability/Micro-Services-Topology-Generator

Repository files navigation

Micro-Services Topology Generator (MSTG)

This tool automates the generation of containerized microservices topologies.

From a single user-provided configuration yml file, it generates the intermediary files for Docker Compose or Kubernetes.

The microservices, all instances of the same program, will sequentially send requests to the services they are connected to before responding to their own requests.

Routers can be added between the services to simulate a real network environment.

See generator/README.md for details on the generator of configuration files.

🌐 Architecture of MSTG:

architecture

🚀 Getting Started

Specify the architecture

When invoking make commands, the architecture configuration file can by specified as follows:

CONFIG=<file> make

Alternatively, if no argument are given, make will look for a file named config.yml.

See CONFIGURATION.md for how to write the architecture file and configuration_examples for examples.

Build the Docker images

Then, you need to build the Docker images with the following command:

make images

The Docker images for the CLT version can be build with:

make images_clt

Generate the topology

You have 2 possibilities when it comes to the output of the generator:

  • You can generate a Docker Compose file which can be used to deploy the topology on a single machine.
  • You can generate the configuration files for Kubernetes which can be used to deploy the topology on one or more machines.

Docker Compose

Now, you can generate the architecture with IPv4 or IPv6 with the following commands:

make ipv4
make ipv6

If you want to enable Jaeger to see the traces, you can use one of the following commands depending on whether you want the topology to use IPv4 or IPv6:

make ipv4_jaeger
make ipv6_jaeger

If you want to generate the architecture with CLT, which always uses IPv6 and Jaeger, you can use the command:

make clt

You can add _https at the end of each of the previous command (e.g. make ipv4_https) to use HTTPS instead of HTTP.

Start the architecture

You can start the architecture with:

make start
Make requests to the services

You can make requests to the services using the following commands and replacing <port> with the port of the service to which you want to send a request:

curl "http://127.0.0.1:<port>/" # IPv4 + HTTP
curl -6 "http://[::1]:<port>/" # IPV6 + HTTP
curl --insecure "https://127.0.0.1:<port>/" # IPv4 + HTTPS
curl --insecure -6 "https://[::1]:<port>/" # IPv6 + HTTPS

Choose the command based on which version of IP and HTTP you chose to generate the architecture.

When using HTTPS, you need to add --insecure because the services use a self-signed certificate.

Check the traces

If you decided to enable Jaeger, you can see the traces by opening the URL http://localhost:16686/ in your Web browser of choice.

Stop the architecture

You can stop the architecture with:

make stop

Kubernetes

See K8S.md for explanations regarding the deployment to Kubernetes.

🔍 Cross-Layer Telemetry (CLT)

This tool can be used to demonstrate the capabilities of Cross-Layer-Telemetry.

Telemetry data will be generated with OpenTelemetry and displayed with Jaeger. Furthermore, telemetry data related to the routers will be generated with IOAM and gathered with OpenTelemetry data in Jaeger by using the IOAM collector for Jaeger.

📋 Requirements

In order to use these tools, you need the following:

  • Docker.
  • Docker compose v2 for local deployment.
  • A Kubernetes cluster and the kubectl tool for multi-host deployment. See K8S.md for more info.
  • Go >= 1.21
  • Python >= 3.10.
    • Libraries can be installed with pip3 install -r requirements.txt
  • The following command-line tools: grep, tr, awk, and GNU Make.
  • If you want to use CLT, you need a kernel 5.17 which is patched for CLT.