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.

  1. Log on to the Container Service console. In the left-side navigation pane, choose Ingresses and Load Balancing > Ingresses. Click Create in the upper-right corner to Create an Ingress.
  2. 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

You can use the testing domain or production domain to access the service deployed in the Kubernetes cluster. Because you have not updated DNS settings to point the production domain to the public IP address of the SLB instance, you need to bind the IP address to the production domain on your local computer. Sample domains are as follows:
Note Perform regression testing based on the testing domain or production domain and make sure that the Kubernetes service works as expected.

Check logs

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.

  1. Log on to the Log Service console and click the target project name.
  2. On the Logstores tab, you can see the following Logstores.
  3. 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.

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

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