This topic describes how to use regression testing to validate the functions of a service.
Set a testing domain
In Kubernetes clusters, you can configure port mapping to enable communication between services within the cluster and configure Ingresses to connect to these services from outside the cluster.
When you configure an Ingress, you can set multiple domains such as production domains and testing domains. Production domains are usually domains that have obtained ICP filings. You need to enter the fully-qualified domain name. Testing domains are usually provided by Container Service. You can enter the prefix of the testing domain. Use the following steps to configure an Ingress.
- Log on to the Container Service console. In the left-side navigation pane, choose . Click Create in the upper-right corner to Create an Ingress.
- After the Ingress is created, you can find its domain and endpoint on the Ingresses page. The endpoint of the Ingress is the public IP address of the SLB instance attached to the cluster.
Test the service functions
As described in Migrate log configurations of applications, Swarm and Kubernetes adopt different rules to generate Logstores. The logs of Swarm services and Kubernetes services are saved in the same project, but different Logstores. During the test process, you can check the Logstores created by Kubernetes to see if the Kubernetes service is running normally.
- Log on to the Log Service console and click the target project name.
- On the Logstores tab, you can see the following Logstores.
- Select the target Logstore and click Search & Analysis to check logs and see if the output is normal.
Check monitoring settings
After you make sure that logs in the Logstores are normal, you need to check whether the corresponding monitoring services, such as Application Real-Time Monitoring Service (ARMS) and LogShipper, are correctly configured. For more information, see Log Service - Real-time consumption. Check the settings based on your actual needs.
This example uses CloudMonitor to monitor the running status of swarm-piggymetrics.
- View host monitoring data. For more information, see How do I view the monitoring data for a specified date or data range in the CloudMonitor console?.
When you create a Kubernetes cluster, you can choose to install the CloudMonitor agent on ECS nodes. This allows you to monitor the workloads and network status on each node and check whether test traffic is routed to the Kubernetes cluster.
- View log monitoring data. For more information, see Log Service.
You can use ARMS to monitor services in further depth. This example creates a log monitoring task named findAccountCount_k8s to monitor the logs of cluster nodes and process log data based on parsing rules. You can detect test traffic through monitoring charts.Note The preceding figure shows the steady increase of account queries over a short time period. This proves that cluster k8s-piggymetrics-cluster handles test traffic and provides services externally.