Project: Meshery (Provisioning / Automation & Configuration)
File: architecture.md

layout: default title: Architecture permalink: concepts/architecture redirect_from: architecture type: components abstract: overview of different individual components of Meshery architecture and how they interact as a system. language: en list: include Meshery and its components are written using the following languages and technologies. | Components | Languages and Technologies | | :- | :-- | | Meshery Server | Golang, gRPC, GraphQL, | | | Golang, gRPC, , , | | | Rust and C++ | | Meshery UI | ReactJS, NextJS, BillboardJS | | Meshery Provider UI | ReactJS, NextJS | | | any - must adhere to Meshery | | | Golang | | &nbsp;&nbsp;&nbsp;&nbsp; | Golang | | &nbsp;&nbsp;&nbsp;&nbsp; | Golang, NATS | | | Golang, SQLlite | | | Golang | Meshery deploys as a set of containers. Meshery's containers can be deployed to either Docker or Kubernetes. Meshery components connect to one another via gRPC requests. Meshery Server stores the location of the other components and connects with those components as needed. Typically, a connection from Meshery Server to Meshery Adapters is initiated from a client request (usually either `mesheryctl` or Meshery UI) to gather information from the Adapter or invoke an Adapter's operation. In Meshery v0.6.0, Adapters will register with Meshery Server over HTTP POST. If Meshery Server is not available, Meshery Adapters will backoff and retry to connect to Meshery Server perpetually. <a href="{{ site.baseurl }}/assets/img/architecture/meshery-architecture.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/meshery-architecture.svg" width="50%" /></a> Figure: Meshery deploys inside or outside of a Kubernetes cluster Each Meshery Adapter delivers its own unique specific functionality. As such, at time of deployment, the Meshery Adapter will register its cloud native infrastructure-specific capabilities (its operations) with Meshery Server's capability registry. <a href="{{ site.baseurl }}/assets/img/adapters/meshery-adapter-operation-registration.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/adapters/meshery-adapter-operation-registration.svg" width="50%" /></a> Figure: Meshery Adapter Operation Registration Meshery's REST API may be consumed by any number of clients. Clients need to present valid JWT token. <a href="{{ site.baseurl }}/assets/img/architecture/Meshery-client-architecture.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/Meshery-client-architecture.svg" width="50%" /></a> Figure: Clients use Meshery's , , or a combination of both. As a point of extensibility, Meshery supports two types of : Local and Remote. <a href="{{ site.baseurl }}/assets/img/architecture/Meshery-provider-architecture.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/Meshery-provider-architecture.svg" width="50%" /></a> <figure> <figcaption>Figure: Meshery Provider architecture</figcaption> </figure> This diagram outlines logical constructs within Meshery and their relationships. <a href="{{ site.baseurl }}/assets/img/architecture/mesheryextensionpoints.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/mesheryextensionpoints.svg" width="50%" /></a> <figure> <figcaption>Figure: Meshery Object Model</figcaption> </figure> Meshery Operator is the multi-cluster Kubernetes operator that manages MeshSync and Meshery Broker. <a href="{{ site.baseurl }}/assets/img/architecture/meshery-operator-and-meshsync.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/meshery-operator-and-meshsync.svg" width="50%" /></a> <figure> <figcaption>Figure: Meshery Operator and MeshSync</figcaption> </figure> See the section for more information on the function of an operator and section for more information on the function of

Meshery Server's database is responsible for collecting and centralizing the state of all elements under management, including infrastructure, application, and Meshery's own components. Meshery's database, while persisted to file, is treated as a cache. <a href="{{ site.baseurl }}/assets/img/architecture/meshery-database.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/meshery-database.svg" width="50%" /></a> <figure> <figcaption>Figure: Meshery Docker Extension</figcaption> </figure> See the section for more information on the function of the database. Meshery's Docker extension provides a simple and flexible way to design and operate cloud native infrastructure on top of Kubernetes using Docker containers. The architecture of this extension is designed to be modular and extensible, with each component serving a specific purpose within the overall deployment process. <a href="{{ site.baseurl }}/assets/img/architecture/meshery-docker-extension.svg" class="lightbox-image"> <img src="{{ site.baseurl }}/assets/img/architecture/meshery-docker-extension.svg" width="50%" /></a> <figure> <figcaption>Figure: Meshery Docker Extension</figcaption> </figure> The Command Line Interface ( also known as ) that is used to manage Meshery. Use `mesheryctl` to both manage the lifecycle of Meshery itself and to access and invoke any of Meshery's application and cloud native management functions. Some components within Meshery's architecture are concerned with persisting data while others are only concerned with a long-lived configuration, while others have no state at all. | Components | Persistence | Description | | :- | :-- | :-- | | | stateless | command line interface that has a configuration file | | | stateless | interface with cloud native infrastructure on a transactional basis | | Meshery Server | caches state | application cache is stored in `$HOME/.meshery/` folder | | | stateful | location of persistent user preferences, environment, tests and so on | | | stateless | operator of Meshery custom controllers, notably MeshSync | | | stateless | Kubernetes custom controller, continuously running discovery | Meshery uses the following list of network ports to interface with its various components: {% for adapter in site.adapters -%} {% if adapter.port -%} {% capture adapter-ports %} | <img src="{{ adapter.image }}" style="width:20px" /> | {{ adapter.port }}/gRPC | Communication with Meshery Server | {% endcapture %} {% endif -%} {% endfor %} | Component | Port | Purpose | | :-- | :: | :--| | Meshery Server | 9081/tcp | UI, REST and GraphQL APIs | | Meshery Server | 80/tcp | Websocket | | | 4222/tcp | Client communication with Meshery Server | | | 8222/tcp | HTTP management port for monitoring Meshery Broker. Available as of Meshery v0.5.0 | | | 6222/tcp | Routing port for Broker clustering. Unused as of Meshery v0.6.0-rc-2 | | | 7422/tcp | Incoming/outgoing leaf node connections. Unused as of Meshery v0.6.0-rc-2 | | | 7522/tcp | Gateway to gateway communication. Unused as of Meshery v0.6.0-rc-2 | | | 7777/tcp | used for Prometheus NATS Exporter. Unused as of Meshery

| | Learn Layer5 Application | 10011/tcp | SMI conformance testing | | ) | 443/tcp | e.g. Meshery Cloud | {% for adapter in site.adapters -%} {% if adapter.port -%} | <img src="{{ adapter.image }}" style="width:20px" data-logo-for-dark="{{ adapter.white_image }}" data-logo-for-light="{{ adapter.image }}" id="logo-dark-light" loading="lazy"/> | {{ adapter.port }} | Communication with Meshery Server | {% endif -%} {% endfor -%} | | 10013/gRPC | Performance Management| See the section for more information on the function of an adapter. <table style=" padding-right: 10px; margin: 5px 5px 5px 5px; display: block; max-width: fit-content; overflow-x: auto; white-space: nowrap;"> <thead> <tr> <th>Connection Type</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>Action / Behaviour</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>&nbsp;</th> <th>&nbsp;</th> </tr> </thead> <tbody> <tr> <td>&nbsp;</td> <td><strong>Connect mesheryctl</strong></td> <td><strong>Connect Meshery UI</strong></td> <td><strong>Disconnect</strong></td> <td><strong>Ad hoc Connectivity Test</strong></td> <td><strong>Ongoing Connectivity Test</strong></td> <td><strong>Synthetic Check</strong></td> <td><strong>Deploy mesheryctl</strong></td> <td><strong>Undeploy mesheryctl</strong></td> <td><strong>Deploy Meshery UI</strong></td> <td><strong>Undeploy Meshery UI</strong></td> <td>&nbsp;</td> </tr> <tr> <td>Kubernetes clusters</td> <td>`system start`</td> <td>Upload kubeconfig</td> <td>Click "X" on chip</td> <td>On click of connection chip</td> <td>Yes, via MeshSync</td> <td>No</td> <td>No</td> <td>No</td> <td>No</td> <td>No</td> <td>&nbsp;</td> </tr> <tr> <td>Grafana Servers</td> <td>No</td> <td>Enter IP/hostname into Meshery UI</td> <td>Click "X" on chip</td> <td>On click of connection chip</td> <td>No</td> <td>No</td> <td>No</td> <td>No</td> <td>No</td> <td>No</td> <td>&nbsp;</td> </tr> <tr> <td>Prometheus Servers</td> <td>No</td> <td>Enter IP/hostname into Meshery UI</td> <td>Click "X" on chip</td> <td>On click of connection chip</td> <td>Yes, when metrics are configured in a dashboard</td> <td>Yes</td> <td>No</td> <td>No</td> <td>No</td> <td>No</td> <td>&nbsp;</td> </tr> <tr> <td><a href="/concepts/architecture/adapters">Meshery Adapters</a></td> <td>`system check`</td> <td>Server to Adapter on every UI refresh</td> <td>Click "X on" chip</td> <td>Server to Adapter every click on adapter chip in UI</td> <td>Server to Adapter every 10 seconds</td> <td>-</td> <td>Yes, as listed in meshconfig contexts</td> <td>Yes, as listed in meshconfig contexts</td> <td>Toggle switch needed</td> <td>Toggle switch needed</td> <td>&nbsp;</td> </tr> <tr> <td><a href="/concepts/architecture/operator">Meshery Operator</a></td> <td>`system check`</td> <td>Upon upload of kubeconfig</td> <td>No</td> <td>On click of connection chip in UI to Server to Kubernetes to Meshery Operator</td> <td>No</td> <td>-</td> <td>`system start`</td> <td>`system stop`</td> <td>Upon upload of kubeconfig & Toggle of switch</td> <td>Toggle of switch</td> <td>&nbsp;</td> </tr> <tr> <td><a href="/concepts/architecture/meshsync">MeshSync</a></td> <td>`system check`</td> <td>follows the lifecycle of Meshery Operator</td> <td>No</td> <td>On click of connection chip in UI to Server to Kubernetes to Meshery Operator to MeshSync</td> <td>Managed by Meshery Operator</td> <td>On click of connection chip</td> <td>follows the lifecycle of Meshery Operator</td> <td>follows the lifecycle of Meshery Operator</td> <td>follows the lifecycle of Meshery Operator</td> <td>follows the lifecycle of Meshery Operator</td> <td>&nbsp;</td> </tr> <tr> <td><a href="/concepts/architecture/broker">Broker</a></td> <td>`system check`</td> <td>follows the lifecycle of Meshery Operator</td> <td>No</td> <td>On click of connection chip in UI to Server to Brokers exposed service port</td> <td>NATS Topic Subscription</td> <td>On click of connection chip</td> <td>follows the lifecycle of Meshery Operator</td> <td>follows the lifecycle of Meshery Operator</td> <td>follows the lifecycle of Meshery Operator</td> <td>follows the lifecycle of Meshery Operator</td> <td>&nbsp;</td> </tr> </tbody> </table> <br> Please also see the and the