Application Mesh
The application mesh function is available only for platinum service instances.
Scenario
The application mesh is a non-intrusive microservice governance solution that supports full-lifecycle management and traffic management such as load balancing.
The application mesh involves Services and gateways:
- Services: A Service defines a set of instances and a means of accessing them. The Service name can be resolved to the corresponding IP address through which applications on edge nodes can access each other.
- Gateways: A gateway exposes edge applications deployed using IEF to external applications and forwards traffic through virtual services.
As shown in the following figure, if you access {IP address of the edge node where the gateway application is located}:{Gateway port}/URI, the traffic can be forwarded to the corresponding Service, which then forwards the traffic to the corresponding backend application instance.
Creating a Service
- Log in to the IEF console.
- In the navigation pane, choose Application Mesh > Service List. On the page displayed, click Create Service in the upper right corner.
- Set the parameters.
- Service Name: Enter a Service name.
- Application: Select the application that the Service is bound to.
- Port Settings:
- Access Port: indicates the port used to access the containerized application.
- Container Port: indicates the port on which the containerized application listens.
Figure 2 Creating a Service
- Click Create. After the creation is complete, you can view the internal access domain name in the Service list.Figure 3 Viewing the Service access domain name
Configuring a Traffic Policy
A traffic policy defines how service traffic is forwarded to multiple application instances.
- Log in to the IEF console.
- In the navigation pane, choose Application Mesh > Service List. Click Traffic Policy at the row where the Service resides. Figure 4 Service list
- On the page displayed, select a traffic policy type. Currently, the following traffic policy types are supported:
- Load Balancing Algorithm: Two forwarding modes, that is, ROUND_ROBIN and RANDOM, are supported.
- Session persistence: Three HTTP header-based forwarding modes, that is, Cookie, User-Agent, and Custom, are supported.
Figure 5 Selecting a traffic policy
- Click OK.
Deploying an Edge Gateway Application
Edge gateway applications must be deployed on edge nodes. IEF has made an edge gateway image available on the edge marketplace. You can apply for the edge gateway image and deploy it to your edge nodes.
- Log in to the Edge Application Center, find the application named Edge Gateway-x86_64, and click Apply for authorization.
- After the authorization is complete, click Deploy.
- Select the edge node where the gateway is to be deployed and click Next. Then, configure the other parameters and click Create.
For details on how to deploy an application, see Containerized Applications.
An edge gateway application can listen on multiple IP addresses of an edge node. To enable an application to listen on multiple IP addresses, set the NIC, INCLUDE_IP, and EXCLUDE_IP environment variables during application deployment by following the description in Table 1. The edge gateway application filters IP addresses based on INCLUDE_IP and then EXCLUDE_IP. If INCLUDE_IP and EXCLUDE_IP contain the same IP address, the application will not listen on this IP address.
Table 1 Environment variables for implementing listening on multiple IP addresses Environment Variable
Description
Default Value
Example
NIC
List of NICs to be listened on. Use commas (,) to separate multiple NIC names.
If this parameter is left blank or set to *, information about all NICs will be listened on. If none of the specified NICs exist, the application will not listen on any IP address.
*
(indicating that information about all NICs will be listened on)
eth0,lo
INCLUDE_IP
List of IP addresses bound to NICs to be listened on. The value can be an IP address or an IP address segment. Use commas (,) to separate multiple IP addresses.
If this parameter is left blank or set to *, all IP addresses bound to the specified NICs will be listened on.
*
(indicating that all IP addresses bound to the specified NICs will be listened on)
192.168.0.1/24,127.0.0.1
EXCLUDE_IP
List of IP addresses to be excluded from the IP address list obtained from NIC and INCLUDE_IP. The value can be an IP address or an IP address segment. Use commas (,) to separate multiple IP addresses.
If this parameter is left blank, no IP address will be excluded.
There is no default value.
192.168.0.1/24,127.0.0.1
Creating a Gateway
- Log in to the IEF console.
- In the navigation pane, choose Application Mesh > Gateways. On the page displayed, click Create Gateway in the upper right corner.
- Specify the gateway information.
- Gateway Name: Enter a gateway name.
- Application: Select the gateway application deployed in Deploying an Edge Gateway Application.
- Backend Configuration
Port: Enter the port number used by the gateway to access backend applications.
Protocol: Select the protocol used by the gateway to access backend applications.
Domain Name List: Enter the domain names that can be accessed. Regular expression matching is supported. For example, * indicates all domain names.
- HTTP Routes
- URI Match Type: Prefix match, Exact match, and Regular expression are supported.
- URI: Enter a URI.
- Target Service: Select the Service to which the rule matches, that is, the Service to which the traffic from the URI is forwarded.
- Service Access Port: Select the port used by the Service to access the application.
Figure 6 Gateway configuration
Last Article: Function Management
Next Article: Edge-Cloud Messages
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.