Microservices Governance
Microservices Application
General
Note: To use the microservices
governance feature in a cluster, the microservices governance component must be
deployed in the cluster first. You can enable the microservices governance component
when creating the cluster, or deploy it from the component list on the cluster details
page.Creating a Microservices Application
In the ZStack Zaku main menu, select . On the Microservices Application page, click Create Microservices Application and the Create Microservices Application page is displayed.
- Name: set the name of the microservices application. Naming rules: the length is limited to 1-50 characters, the input can contain only lowercase letters, digits and hyphens (-), and it must start with a lowercase letter and end with a digit or a lowercase letter.
- Description: optional. Add remarks about the microservices application.
- Workload: specify the workloads of the microservices
application. You can select existing workloads or create new ones.
- Select existing: directly select an existing workload.
Note: One workload can be associated with only one
microservices application. - Create: create a new workload and associate it with the microservices application. For details, see Creating Workloads.
- Select existing: directly select an existing workload.
- Workload Version: set the workload version. Version rules:
the length is limited to 1-50 characters, the input can contain only lowercase
letters, digits and hyphens (-), and a hyphen cannot be used at the beginning or the
end.
Note: If the workload already has the zsedge.io/version
label, the value of this label is used as the workload version by default. It can
be modified manually, and the modified value overwrites the zsedge.io/version
label of the workload. - Service: specify the services of the workloads. You can select
existing services or create new ones.
- Select existing: directly select an existing service.
Note: An existing service must be associated with the
workloads of the microservices application. - Create: create a new service. For details, see Creating Services
- Select existing: directly select an existing service.
Managing Microservices Applications
In the ZStack Zaku main menu, click to enter the Microservices Application page.
Microservices applications support the following operations:
| Operation | Description |
|---|---|
| Create microservices application | Create a new microservices application. |
| Canary release | Create a canary release to update the workloads under the
microservices application by means of a canary release. Note:
|
| Delete microservices application | Delete the microservices application. Note: Deleting a microservices application also deletes
the service mesh resources under it. |
Canary Release
- Creating a canary release task
- Monitoring the canary release
- Adjusting the traffic policy
- Taking over all traffic and taking a version offline
Service Topology
General
Note: To use the
microservices governance feature in a cluster, the microservices governance component
must be deployed in the cluster first. You can enable the microservices governance
component when creating the cluster, or deploy it from the component list on the cluster
details page.Viewing the Topology Map
In the ZStack Zaku main menu, select to enter the Service Topology page.
- Displaying the requests per second, request success rate, request latency and number of pods of a workload.
- Refreshing automatically every minute to obtain the latest data and display it in real time.
- Selecting a time period to view the topology of the selected period.
Note: If there is no traffic between the microservices
applications during the selected period, the topology map displays only the nodes,
without connection lines. - The connection lines between nodes are green, yellow or red, which shows the request success rate intuitively. The color thresholds of the request success rate are: green (greater than or equal to 99.9%), yellow (greater than or equal to 80% and less than 99.9%) and red (less than 80%).
- Zooming in, zooming out and full-screen viewing.
Traffic Management
In the ZStack Zaku main menu, select to enter the Service Topology page. On the topology map, click the microservices application or workload for which traffic management is to be performed, and the Traffic Management page is displayed.
- Load balancing: select whether to configure load balancing
parameters. It is disabled by default. If it is enabled, set the following
parameters:
- Load balancing policy: select the load balancing
policy. Four policies are supported: least requests, round robin, random and
session persistence. The default policy is least requests.
Note:
- Least requests: sends the access traffic to the pod that has the fewest requests currently.
- Round robin: sends the access traffic to each pod in turn.
- Random: sends the access traffic to any pod randomly.
- Session persistence: based on a hash algorithm, assigns the traffic that meets the conditions to the same pod, to ensure session continuity and consistency.
If you select session persistence, the traffic that meets the conditions is assigned to the same pod based on a hash algorithm, to ensure session continuity and consistency. Set the following parameters:- Session persistence algorithm: set the
session persistence algorithm. Three algorithms are supported: based
on HTTP Header hash, based on HTTP Cookie hash and based on source IP
address hash. The default algorithm is based on HTTP Header hash.If you select based on HTTP Header hash, the session is kept according to the information in the Header, and the requests that have the same specified key value in the Header are sent to the same pod. Set the following parameters:
- HTTP Header key: set the name of the specified Header key to be used for the HTTP Header hash.
If you select based on HTTP Cookie hash, the session is kept according to the Cookie information, and the requests that have the same specified information in the Cookie are sent to the same pod. Set the following parameters:- Cookie name: set the Cookie name to be used for the HTTP Cookie hash.
- Cookie path: optional. Set the Cookie path to be used for the HTTP Cookie hash.
- Cookie validity period: optional. Set the validity period of the Cookie to be used for the HTTP Cookie hash. Unit: second.
If you select based on source IP address hash, the session is kept according to the HTTP source IP address information, and the requests from the same source IP address are sent to the same pod.
- Load balancing policy: select the load balancing
policy. Four policies are supported: least requests, round robin, random and
session persistence. The default policy is least requests.
- Connection pool: select whether to configure connection pool
parameters. It is disabled by default. If it is enabled, set the following
parameters:
- Max pending requests: set the maximum number of pending requests of the connection pool. It can only be a positive integer.
- Max requests: set the maximum number of requests allowed by the connection pool. It can only be a positive integer.
- Max requests per connection: set the maximum number of
requests allowed per connection. It can only be a positive integer.
Note: If the max requests per connection is set to 1,
session persistence is disabled. - Max retries: set the maximum number of retries. It can only be a positive integer.
- Connection timeout: set the connection timeout period. Unit: second. It can only be a positive integer.
- Circuit breaking: select whether to enable circuit breaking.
It is disabled by default. If it is enabled, set the following parameters:
Note: Circuit breaking is a mechanism that passively keeps HTTP
services healthy. When the requests sent to a pod return 5xx response errors
consecutively and the specified number of times is reached, this pod is ejected.
During the ejection, client requests are not sent to this pod.- Number of consecutive 5xx errors: specify after how many consecutive 5xx error responses a pod is ejected. It can only be a positive integer.
- Detection interval: set the detection interval. Unit: second. It can only be a positive integer.
- Min ejection duration: set the minimum ejection duration. Unit: second. It can only be a positive integer. The ejection duration of a pod = the min ejection duration * the number of times that this pod has been ejected.
- Max ejection percent: set the maximum ejection percentage. It can only be an integer from 1 to 100. The number of pods that can be ejected = the total number of pods * the max ejection percent. When the calculation result is not an integer, it is rounded down automatically.
Trace Tracking
General
Note: To use the microservices governance feature in a cluster,
the microservices governance component must be deployed in the cluster first. You can
enable the microservices governance component when creating the cluster, or deploy it
from the component list on the cluster details page.Viewing Call Chain Data
In the ZStack Zaku main menu, select to enter the Trace Tracking page. You can query call chains by service name, TraceID and request time, and a custom time period is supported. Each data entry shows one request operation, including the access time, the request duration, the number of spans and the information of each span.
Click a request to go to the details page, where you can view the detailed information of the request.
