Recording HTTP traffic in Istio
You can in combination with HCL OneTest™ Server, which is installed with the demo configuration, record HTTP requests and responses that are sent and received by services deployed in the Istio services mesh.
Before you begin
- Installed HCL OneTest™ Server with the demo configuration. Refer to the Installation of HCL OneTest™ Server topics in the Server documentation.
- Installed the sample Bookinfo application into a namespace called bookinfo in the same Kubernetes cluster as HCL OneTest™ Server. Note: The Bookinfo application in this example task uses a gateway URL as http://www.rtas-bookinfo.com.
- Created a Kubernetes rolebinding between the cluster role rockstar-execution-istio-test-system and the HCL OneTest™ Server execution service account test-system:rockstar-execution. This rolebinding allows HCL OneTest™ Server to manage the required Kubernetes resources in the bookinfo namespace so that the HTTP traffic going through Istio can be recorded.
- Configured your user offline token that you generated on HCL OneTest™ Server in the Server Settings tab in HCL OneTest™ API so that HCL OneTest™ API can access HCL OneTest™ Server. See Accessing HCL OneTest Server.
About this task
The sample Bookinfo application is a demo application provided by Istio that demonstrates the various features of Istio. This task first walks you through recording the service to service requests received by the reviews microservice and then through the recording of ingress requests (requests made from outside the cluster, for example from a browser) to the productpage microservice. These recorded messages can then be used to create a stub which can then be run on HCL OneTest™ Server to virtualize the actual service.
Procedure
-
Create an HTTP Connection in the Logical View.
You must enter reviews in the name field. A logical HTTP Connection resource is created and a physical Web Server resource also called reviews is created and bound together in the current environment.
-
Open the physical Web Server resource by right clicking the logical HTTP Connection, and then selecting Physical Resource.
The Web Server dialog is displayed.
-
Enter the name of the service as reviews in the Host field.
As the service hostname is resolved against the namespace it is contained in, you can enter the alternate names of the service. For example, reviews.bookinfo, reviews.bookinfo.svc or reviews.bookinfo.svc.cluster.local.
-
Enter 9080 as the port in the Port field.
Restriction: The Test Transport action is not supported for Kubernetes services because the web server configured in the settings tab is a service within the Kubernetes cluster and the host and port that are configured are not reachable to HCL OneTest™ API.
-
Click the Recording tab, and select the Istio option.
HCL OneTest™ API instructs the recording studio to use Istio when recording this transport. The transport is now ready to be used to record the HTTP requests and responses going to the reviews service of the BookInfo application.
-
Switch to the Recording Studio perspective, and then click the Add monitor button.
The resource selector dialog is displayed.
- Select the logical HTTP Connection for the reviews service.
- Start recording by clicking the Record button.
- Open a browser and open the URL http://www.rtas-bookinfo.com/productpage.
Results
You can view a request and response in the Recording Studio.