Architecture

Components, their Purpose, and Languages

Meshery and its components are written using the following languages and technologies.

ComponentsLanguages and Technologies
Meshery ServerGolang, gRPC, GraphQL, SMP
Meshery DatabaseGolang, SQLlite
Meshery UIReactJS, NextJS, BillboardJS
Meshery Provider UIReactJS, NextJS
Meshery OperatorGolang
MeshSyncGolang
BrokerGolang, NATS
Meshery CLIGolang
Extensions
Meshery AdaptersGolang, gRPC, CloudEvents
Meshery Remote Providersany - must adhere to Meshery Extension Points
Envoy WASM FiltersRust and C++

Deployments

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.

Adapters

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.

Figure: Meshery deploys inside or outside of a Kubernetes cluster

Adapters and Capabilities Registry

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.

Figure: Meshery Adapter Operation Registration

Clients

Meshery’s REST API may be consumed by any number of clients. Clients need to present valid JWT token.

Figure: Clients use Meshery’s REST API, GraphQL API, or a combination of both.

Providers

As a point of extensibility, Meshery supports two types of providers: Local and Remote.

Figure: Meshery Provider architecture

Object Model

This diagram outlines logical constructs within Meshery and their relationships.

Figure: Meshery Object Model

Meshery Operator and MeshSync

Meshery Operator is the multi-cluster Kubernetes operator that manages MeshSync and Meshery Broker.

Figure: Meshery Operator and MeshSync

See the Operator section for more information on the function of an operator and MeshSync section for more information on the function of meshsync.

Database

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.

Figure: Meshery Docker Extension

See the Database section for more information on the function of the database.

Meshery Docker Extension

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.

Figure: Meshery Docker Extension

Meshery CLI

The Command Line Interface ( also known as mesheryctl ) 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.

Statefulness in Meshery components

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.

ComponentsPersistenceDescription
mesheryctlstatelesscommand line interface that has a configuration file
Meshery Adaptersstatelessinterface with cloud native infrastructure on a transactional basis
Meshery Servercaches stateapplication cache is stored in $HOME/.meshery/ folder
Meshery Providersstatefullocation of persistent user preferences, environment, tests and so on
Meshery Operatorstatelessoperator of Meshery custom controllers, notably MeshSync
MeshSyncstatelessKubernetes custom controller, continuously running discovery

Network Ports

Meshery uses the following list of network ports to interface with its various components:

ComponentPortPurpose
Meshery Server9081/tcpUI, REST, and GraphQL APIs
Meshery Server80/tcpWebSocket
Meshery Broker4222/tcpClient communication with Meshery Server
Meshery Broker8222/tcpHTTP management port for monitoring Meshery Broker. Available as of Meshery v0.5.0
Meshery Broker6222/tcpRouting port for Broker clustering. Unused as of Meshery v0.6.0-rc-2
Meshery Broker7422/tcpIncoming/outgoing leaf node connections. Unused as of Meshery v0.6.0-rc-2
Meshery Broker7522/tcpGateway to gateway communication. Unused as of Meshery v0.6.0-rc-2
Meshery Broker7777/tcpUsed for Prometheus NATS Exporter. Unused as of Meshery v0.6.0-rc-2
Meshery Remote Providers443/tcpe.g. Meshery Cloud
Meshery Perf10013/gRPCPerformance Management
Meshery Adapter for Traefik Mesh10006/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for NGINX Service Mesh10010/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Network Service Mesh10004/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Linkerd10001/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Kuma10007/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Istio10000/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Consul10002/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Cilium Service Mesh10012/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for App Mesh10005/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Tanzu Service Mesh10011/gRPC/gRPCCommunication with Meshery Server
Meshery Adapter for Nighthawk10013/gRPC/gRPCCommunication with Meshery Server

See the Adapters section for more information on the function of an adapter.

Meshery Connections and their Actions

Connection TypeConnect mesheryctlConnect Meshery UIDisconnectAd hoc Connectivity TestOngoing Connectivity TestSynthetic CheckDeploy mesheryctlUndeploy mesheryctlDeploy Meshery UIUndeploy Meshery UI
Kubernetes clusterssystem startUpload kubeconfigClick “X” on chipOn click of connection chipYes, via MeshSyncNoNoNoNoNo
Grafana ServersNoEnter IP/hostname into Meshery UIClick “X” on chipOn click of connection chipNoNoNoNoNoNo
Prometheus ServersNoEnter IP/hostname into Meshery UIClick “X” on chipOn click of connection chipYes, when metrics are configured in a dashboardYesNoNoNoNo
Meshery Adapterssystem checkServer to Adapter on every UI refreshClick “X on” chipServer to Adapter every click on adapter chip in UIServer to Adapter every 10 seconds-Yes, as listed in meshconfig contextsYes, as listed in meshconfig contextsToggle switch neededToggle switch needed
Meshery Operatorsystem checkUpon upload of kubeconfigNoOn click of connection chip in UI to Server to Kubernetes to Meshery OperatorNo-system startsystem stopUpon upload of kubeconfig & Toggle of switchToggle of switch
MeshSyncsystem checkfollows the lifecycle of Meshery OperatorNoOn click of connection chip in UI to Server to Kubernetes to Meshery Operator to MeshSyncManaged by Meshery OperatorOn click of connection chipfollows the lifecycle of Meshery Operatorfollows the lifecycle of Meshery Operatorfollows the lifecycle of Meshery Operatorfollows the lifecycle of Meshery Operator
Brokersystem checkfollows the lifecycle of Meshery OperatorNoOn click of connection chip in UI to Server to Brokers exposed service portNATS Topic SubscriptionOn click of connection chipfollows the lifecycle of Meshery Operatorfollows the lifecycle of Meshery Operatorfollows the lifecycle of Meshery Operatorfollows the lifecycle of Meshery Operator

Please also see the Troubleshooting Toolkit and the Meshery v0.7.0: Connection States (Kubnernetes) Design Review

Architectural Concepts

  • Adapters - Adapters extend Meshery's management capabilities in any number of ways, including lifecycle, configuration, performance, governance, identity...
  • Broker - Meshery broker component facilitates data streaming between kubernetes cluster components and outside world.
  • Catalog - Browsing and using cloud native patterns
  • Database - Meshery offers support for internal caching with the help of file databases. This has been implemented with several libraries that supports different kinds of data formats.
  • MeshSync - MeshSync ensures Meshery Server is continuously in-sync with the state of infrastructure under management.
  • Operator - Meshery Operator controls and manages the lifecycle of components deployed inside a kubernetes cluster