Manual
Service Mesh

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

  1. Go to Services page

  2. Click Create Service and select EaseMesh

  3. Select an available Kubernetes cluster

  4. Select the number of Control Plane Replicas (no more than the number of Kubernetes cluster Nodes is recommended)

  5. If Shadow Service is required, then check ShadowService for AddOns

  6. If you need to support non-Java services, then you can check Install CoreDN on

  7. Click Create to create the EaseMesh

Deploy Mesh App

  1. Go to_ Apps_ Page

  2. Click Create App,and select Kubernetes App

  3. Click Edit From YAML Template

  4. 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)

  5. Click Submit

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

  7. Click Next

  8. ** **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.

  1. Go to the Service/Ingress page

  2. 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
  3. Click Create Ingress

  4. Using HTTP Client to do the Traffic Test

  5. Go to _Apps/Tracings _to checking the tracing

  6. Go to Trace/Records to see the Span

Canary Release

  1. Go to Service/Canary Release page

  2. 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
  3. Click _Create Canary Release _

  4. Using HTTP Client to test Canary Traffic

Shadow Service

  1. Go to Service/Shadow Service Page

  2. 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
  3. Click Create Shadow Service

  4. Using HTTP Client to test Shadow Traffic

  5. 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