Recording HTTP traffic in Istio
You can in combination with Rational® Test Automation 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 Rational® Test Automation Server with the demo configuration. Refer to the Installation of Rational® Test Automation Server topics in the Server documentation.
- Installed the sample Bookinfo application into a namespace called bookinfo in the same Kubernetes cluster as Rational® Test Automation
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 Rational® Test Automation Server execution service account test-system:rockstar-execution. This rolebinding allows Rational® Test Automation 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 Rational® Test Automation Server in the Server Settings tab in Rational® Integration Tester so that Rational® Integration Tester can access Rational® Test Automation Server. See Accessing Rational Test Automation 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 Rational® Test Automation 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 box is displayed.
-
Enter the name of the service as reviews in the Host field.
As the service host name 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 Rational® Integration Tester.
-
Click the Recording tab, and select the Istio option.
Rational® Integration Tester 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 box 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.