Rate This Document
Findability
Accuracy
Completeness
Readability

Deploying the Test Environment

Before deploying the test environment, obtain and modify the test tool source code, install the test tool dependencies, and deploy the test pod.

  1. Obtain the test tool source code. The tool source code has multiple versions. The release-1.23 is used as an example.
    git clone https://github.com/istio/tools.git -b release-1.23
  2. Go to the operation directory.
    cd tools/perf/benchmark
  3. Modify the test tool source code.

    The test tool source code is developed based on x86. If the test tool source code is used on the AArch64 architecture, perform the following operations:

    1. Modify curlImage in values.yaml.

      Before:

      curlImage: cfmanteiga/alpine-bash-curl-jq:latest

      After:

      curlImage: docker.io/ricsanfre/docker-curl-jq:latest
    2. Modify the templates/fortio.yaml file.
      • Add content after line 511 (before the file is modified):
        {{- else }}                                # Original line 510
                image: {{ $.Values.fortioImage }}  # Original line 511. The following three lines are newly added.
                volumeMounts:
                - name: shared-data
                  mountPath: /var/lib/fortio
                args:                              # Original line 512
      • Add content after line 485 (before the file is modified):
                image: {{ $.Values.curlImage }}   # Original line 485
                imagePullPolicy: IfNotPresent     # Added content
      • In single-node tests (that is, all test pods are deployed on only one node), modify the content in the podAntiAffinity field so that the test pods can be scheduled to the same node.

        Before:

                podAntiAffinity:                                            # Original line 392
                  requiredDuringSchedulingIgnoredDuringExecution:
                  - labelSelector:
                      matchExpressions:
                      - key: app
                        operator: In
                        values: 
        {{- if eq $.name "fortioclient" }}
                        - "fortioserver"
        {{- else }}
                        - "fortioclient"
        {{- end }}
                    topologyKey: "kubernetes.io/hostname"                   # Original line 404

        After:

                podAntiAffinity:
                  preferredDuringSchedulingIgnoredDuringExecution:
                  - weight: 100  
                    podAffinityTerm:  
                      labelSelector:
                        matchExpressions:
                        - key: app
                          operator: In
                          values:
        {{- if eq $.name "fortioclient" }}
                          - "fortioserver"
        {{- else }}
                          - "fortioclient"
        {{- end }}
                      topologyKey: "kubernetes.io/hostname"
      • If the test pods are also deployed on the master node of Kubernetes, perform the following operations:
        • Add the following content after line 417 (before the file is modified) so that the test pods can be scheduled to the master node.
                {{- end }}                   # Original line 417
                tolerations:                 # Align with line 417. Adjust the indentation as required.
                - operator: "Exists"         # Align with line 417. Adjust the indentation as required.
                  effect: "NoSchedule"       # Add two more spaces than line 417.
                containers:                  # Original line 418
                - name: captured             # Original line 419
        • Modify type in line 56 so that the test pod networks are reachable.

          Before:

          type: LoadBalancer
          After:
          type: ClusterIP
  4. Install the test tool dependencies.

    Check the dependencies described in the Prerequisites section in tools/perf/benchmark/README.md. The test tool used in this document depends on Python 3 (version 3.5 or later), pipenv, and Helm.

    • The following is an example of installing openEuler 24.03 LTS SP2 dependencies:
      yum install python3 -y
      pip install --user pipenv
      
      # Display the user base.
      python3 -m site --user-base 
      # The preceding command displays ~/.local. Run the following export command to add ~/.local/bin to PATH to make pipenv available.
      export PATH=$PATH:~/.local/bin
      
      ## Manually install Helm. Download the corresponding binary package (see Table 2) and run the following commands:
      tar -zxvf helm-v3.14.3-linux-arm64.tar.gz 
      sudo mv linux-arm64/helm /usr/local/bin/helm
      
      # Verification
      helm version
    • The following is an example of installing the Debian 12 bookworm dependencies:
      apt install python3 pipx -y
      pipx install pipenv # Install pipenv.
      pipx ensurepath # Add ~/.local/bin to PATH to make pipenv available.
      
      ## Manually install Helm. Download the corresponding binary package and run the following commands:
      tar -zxvf helm-v3.14.3-linux-arm64.tar.gz 
      sudo mv linux-arm64/helm /usr/local/bin/helm
      
      # Verification
      helm version
  5. Deploy the test pods.
    • Before deploying the test environment, ensure that the network environment can pull the required container images. If not, prepare the images and import them to the target environment. The following container images are required for the test tool release-1.23:

      fortio/fortio:latest_release

      docker.io/istio/proxyv2:1.23.4-distroless

      ricsanfre/docker-curl-jq:latest

    • The target environment indicates the nodes to be tested in the Kubernetes cluster. You can modify the tools/perf/benchmark/fortio.yaml file to schedule the test pods to a specified node. If you are not familiar with the operations, import the related images to all nodes.
    1. Run the following command to load the related module:
      modprobe iptable_nat
    2. Run the following commands in the tools/perf/benchmark directory:
      export NAMESPACE=twopods-istio
      export INTERCEPTION_MODE=REDIRECT
      export ISTIO_INJECT=true
      export LOAD_GEN_TYPE=fortio
      export DNS_DOMAIN=v104.qualistio.org
      chmod +x ./setup_test.sh
      ./setup_test.sh
  6. Prepare the Python test environment.
    1. Go to the tools/perf/benchmark directory.
      cd tools/perf/benchmark
    2. Create a local virtual Python environment.
      pipenv shell
    3. Install the required Python packages.
      pipenv install

      If the installation is successful, information similar to the following is displayed: