This topic describes how to use regression testing to check whether your applications run as expected in a cluster of Container Service for Kubernetes (ACK).
Set a testing domain name
In an ACK cluster, you can configure Service ports to enable communication among Services in the cluster. You can configure Ingresses to enable external access to Services in an ACK cluster.
When you configure an Ingress, you can set multiple domain names such as production domain names and testing domain names. Production domain names are domain names that have obtained Internet Content Provider (ICP) numbers. You must enter the fully-qualified domain name. Testing domain names are provided by ACK. You can enter the prefix of the testing domain name. Perform the following steps to create and configure an Ingress:
- Log on to the ACK console.
- In the left-side navigation pane, click Clusters.
- On the Clusters page, click the name of a cluster or click Details in the Actions column. The details page of the cluster appears.
- In the left-side navigation pane, click Ingresses.
- In the upper-right corner of the Ingresses page, click Create.For more information about how to create and configure an Ingress, see Create an Ingress.
- After the Ingress is created, you can find its domain name and endpoint on the Ingresses
page.Note The endpoint of the ingress is the public IP address of the Server Load Balancer (SLB) instance that is attached to the ACK cluster.
Test whether your applications run as expected
Check application events
The Logstores for a Swarm cluster and the related ACK cluster are generated based on different rules. For more information, see Migrate log configurations of applications. Therefore, application events of a Swarm cluster and the related ACK cluster are logged in different Logstores under the same Log Service project. During the test process, you can check whether application events are logged to the Logstore created for the ACK cluster and whether the events indicate that applications run as expected.
- Log on to the Log Service console. In the Projects section, click the Log Service project that is used.
- On the details page of the Log Service project, click the Logstores tab. In the Logstore list, you can find the Logstores for the Swarm and ACK clusters.
- Select the Logstore for the ACK cluster and click Search to view the application events. This allows you to check whether the applications run as expected.
Check the monitoring metrics of the applications
If application events can be logged to the Logstore for the ACK cluster, you need to check whether the related monitoring services, such as Cloud Monitor, Application Real-Time Monitoring Service (ARMS), message delivery, and storage services are correctly configured based on the Logstore. For more information, see Log Service - Real-time consumption. You must check whether each log consumption scenario is correctly configured based on your actual requirements.
In this example, an application named swarm-piggymetrics is created to demonstrate how to use host monitoring and log monitoring of Cloud Monitor to monitor applications.
- View host monitoring metrics. For more information, see How do I view the monitoring data of a specified time period in the Cloud Monitor console?.
When you create an ACK cluster, you can install the Cloud Monitor agent. The Cloud Monitor agent can be used to monitor the system load and network connections on each node in the ACK cluster. It also allows you to check whether the test traffic is received by the newly create ACK cluster.
- View log monitoring metrics.You can use log monitoring or ARMS to conduct fine-grained application monitoring. In this example, a log monitoring task named findAccountCount_k8s is created based on the existing monitoring rules of the Swarm cluster to monitor the events of nodes in the ACK cluster. Parsing rules are also created to parse the logged events. You can check whether the test traffic is received by the ACK cluster through charts.Note The preceding figure shows the steady increase of account queries over a short time period. This proves that the newly created ACK cluster k8s-piggymetrics-cluster handles test traffic and provides external services.