Service Mesh
The MegaEase Cloud platform can host users' servers, support rapid deployment and management of common software service and cloud-native applications, and allow users to obtain a low-cost, high-availability cloud-native platform that is not locked by the platform.
This document introduces the basic operations of the MegaEase Cloud platform, including the Service Mesh.
Service Mesh
EaseMesh, as a Mesh product, is a service governance platform built on Kubernetes and seamlessly integrated with MegaEase Cloud platform. So the prerequisites for installing Mesh is - there has an available Kubernetes cluster (only one Mesh can be installed in a cluster)
Deploy EaseMesh
-
Go to Services page
-
Click Create Service and select EaseMesh

-
Select an available Kubernetes cluster
-
Select the number of Control Plane Replicas (no more than the number of Kubernetes cluster Nodes is recommended)
-
If Shadow Service is required, then check ShadowService for AddOns
-
If you need to support non-Java services, then you can check Install CoreDN on
-
Click Create to create the EaseMesh

Deploy Mesh App
-
Go to_ Apps_ Page
-
Click Create App,and select Kubernetes App

-
Click Edit From YAML Template
-
Copy the YAML of the app to the edit box (see the appendix for the content, we use Takeoutapp with three services as an example)
-
Click Submit

-
For _Cluster Name , _select the Kubernetes for the mesh installation in step 1 and_ _check the box Whether to enable EaseMesh
-
Click Next

-
** **Click Create

Traffic Demo
Let's test the traffic using Takeoutapp as an example, where the order of invocation of the three services is order-mesh -> restaurant-mesh -> delivery-mesh.
To send traffic from outside to the first service order-mesh, we need to create Ingress for it.
-
Go to the Service/Ingress page
-
Click Create Ingress to create the traffic portal for the Order service

As an example, we fill out the following form.
- Name: order-public
- Exact Path: /
- Backend Service: order-mesh
-
Click Create Ingress

-
Using HTTP Client to do the Traffic Test

-
Go to _Apps/Tracings _to checking the tracing

-
Go to Trace/Records to see the Span

Canary Release
-
Go to Service/Canary Release page
-
Click Create Canary Release

As an example, we fill out the following form.
- Name:beijing
- Services:delivery-mesh;Canary Version:canary_version
- Priority: 3
- Traffic Rules:Header: X-Location; Exact: Beijing
-
Click _Create Canary Release _

-
Using HTTP Client to test Canary Traffic

Shadow Service
-
Go to Service/Shadow Service Page
-
Click Create Shadow Service

As an example, we fill out the following form.
- Name: shadow-order
- Namespace: takeoutapp
- Source Service Name: order-mesh
- Traffic Header Value: pressure-test
-
Click Create Shadow Service

-
Using HTTP Client to test Shadow Traffic

-
Go to _Apps/Tracings _to check Shadow Tracing

Appendix
Takeoutapp complete codebase:Mesh Example (opens in a new tab).
takeoutapp.yaml:
name: takeoutapp
namespace: takeoutapp
cluster_name: easestack
description: An application comprising of order, restaurant, delivery.
easemesh:
enable: true
components:
# Order
- name: order-mesh
enable: true
image: megaease/meshdemo
image_version: latest
type: Stateless
instance_count: 1
named_ports:
- name: http
port: 80
env_variables:
- name: SERVICE_NAME
value: order-mesh
- name: ZIPKIN_URL
value: https://monitor.megaease.com:32430/report/application-tracing-log
resource_require:
cpu: 200m
memory: 256Mi
resource_limit:
cpu: 1200m
memory: 2048Mi
configurations:
- key: listenPort
value: "7700"
use_as_file: /etc/port_config
is_sub_path: true
- key: listenAddr
value: 127.0.0.1
use_as_file: /etc/address_config
is_sub_path: true
# Restaurant
- name: restaurant-mesh
enable: true
image: megaease/meshdemo
image_version: latest
type: Stateless
instance_count: 1
named_ports:
- name: http
port: 80
env_variables:
- name: SERVICE_NAME
value: restaurant-mesh
- name: ZIPKIN_URL
value: https://monitor.megaease.com:32430/report/application-tracing-log
resource_require:
cpu: 200m
memory: 1Gi
resource_limit:
cpu: 2000m
memory: 3Gi
configurations:
- key: listenPort
value: "8800"
use_as_file: /etc/port_config
is_sub_path: true
- key: listenAddr
value: 0.0.0.0
use_as_file: /etc/address_config
is_sub_path: true
# Delivery
- name: delivery-mesh
enable: true
image: megaease/meshdemo
image_version: latest
type: Stateless
instance_count: 1
named_ports:
- name: http
port: 80
env_variables:
- name: SERVICE_NAME
value: delivery-mesh
- name: ZIPKIN_URL
value: https://monitor.megaease.com:32430/report/application-tracing-log
resource_require:
cpu: 200m
memory: 256Mi
resource_limit:
cpu: 1200m
memory: 2048Mi
configurations:
- key: listenPort
value: "9900"
use_as_file: /etc/port_config
is_sub_path: true
- key: listenAddr
value: 127.0.0.1
use_as_file: /etc/address_config
is_sub_path: true