Installing the server software on Ubuntu by using k3s

You can install Rational® Test Automation Server on the Ubuntu server that has a Kubernetes environment to run functional, integration, and performance tests. Rational® Test Automation Server combines test data, test environments, and test runs and reports into a single, web-based browser for testers and non-testers.

Before you begin

  • Completed tasks provided in the Prerequisites section. See Prerequisites for installing the server software on Ubuntu.

  • Ensured that you have installed the following software:

    • OpenSSH server

    • Helm

  • Know the following values to be used during the installation process:

    • The Secret key from the Harbor repository.

    • The ingress DNS name that displayed on completion of the ubuntu-init.sh script.

About this task

As part of the installation process, you might optionally migrate user data from a previous version (V10.0.2, Fix Pack 1 or earlier) the product, or restore a backup of user data from the current version (V10.1.0 or later) of the product. You must perform different steps, depending on which version of the user data backup file you are applying during the installation process. For more details, see the following table:

When you backed up user data from... Then to restore...
Rational® Test Automation Server V10.0.2, Fix Pack 1 or earlier Perform step 6.
Rational® Test Automation Server V10.1.0 or later Perform step 9.

Procedure

  1. Log in to the Ubuntu server as a non-root user.
  2. Create a namespace to install the server software by running the following command:
    kubectl create namespace test-system
  3. Run the following command to get the latest updates from the repository:
    helm repo update
  4. Create a Secret to pull images that are used by Rational® Test Automation Server by running the following command:
    Notes:
    • You must replace {okta-email-address} with the username of the Harbor repository and replace {harbor-cli-secret} with the secret key that you have copied from the Harbor repository.

    • You can replace example@abc.com with the administrator email address, if required.

    kubectl create secret docker-registry hclcr.io \
      -n test-system \
      --docker-server=hclcr.io \
      --docker-username={okta-email-address} \
      --docker-password={harbor-cli-secret} \
      --docker-email=example@abc.com
  5. Run the following command to add the Certificate Authority (CA) certificate into a Secret:
    kubectl create secret generic -n test-system ingress \
    "--from-literal=ca.crt=$(kubectl get -n istio-system secret istio-ingressgateway-certs -ojsonpath='{.data.ca\.crt}' | base64 --decode)"

    When some components such as static agents or Docker agents want to communicate with Rational® Test Automation Server, the component presents its certificate to the server to verify its identity. Rational® Test Automation Server trusts the component only if it is signed by a recognized and trusted CA. To enable certificates as trusted certificates, you must add the signed CA into a trust by placing it in a Secret.

  6. Optional: Perform the following steps to migrate user data from the previous version (V10.0.2, Fix Pack 1 or earlier):
    1. Run the following commands to start a pod and to migrate user data:
      #Retrieve the backup yaml file
      helm repo update
      helm pull --untar hclsoftware/hcl-onetest-server --version 3.1012.0
      
      #Modify the backup yaml file with the release name for your server by replacing {my-ots}
      sed -i 's/{{ \.Release\.Name }}/{my-ots}/g' hcl-onetest-server/files/import-prek8s-backup.yaml
      
      #Apply the backup yaml file to start the import-prek8s-backup pod
      kubectl apply -f hcl-onetest-server/files/import-prek8s-backup.yaml -n test-system
    2. Run the following command to display the import-prek8s-backup pod log.
      kubectl logs import-prek8s-backup -n test-system
    3. Follow the instructions in the log file to copy your backup file to a location where the pod is waiting to process it.

      When the user data backup is migrated, the import-prek8s-backup pod changes from Running to Completed state.

      Note: You can run the kubectl get pod import-prek8s-backup -n test-system command to view the pod state.
    4. Add the additional Helm parameters that the log file displays when the state of the pod is Completed, to the install step 8.
      The following is an example that shows the additional Helm parameters:
      --set keycloak.keycloak.username=admin \
       --set execution.existingPostgresqlPassword=SwztX9JRO/yL9jtgioUiKMGjlsWfM7Ok \
       --set existingKeycloakPassword=jqdV7aveCa3WShkdSF/Z8hAasBupsvp6 \
       --set existingKeycloakPostgresqlPassword=pKVFQUQWRU7BJC6sKeOZIm8zCzLkbXM7 \
       --set existingOauthClientSecret=EMRpHBRurFIMB9X+nfwApnLBBpkvn8+z \
       --set existingPostgresqlPassword=8HY3nADjTZBC2lLj0i7Y7v6wHeEji9ds \
       --set existingSecretsMasterPassword=ibIPh6wGAv0IjsveOrYX1TRwo3ChvxWx \
       --set results.existingPostgresqlPassword=7X3aaAVeHxdzJ+BlFTG7G7rypzsbhd6D \
       --set rm.existingPostgresqlPassword=3uaEx5wTja+PSzvG64O1+cpO3glGAaVt \
       --set tam.existingPostgresqlPassword=7JO95keyZ/F9w5rBcXj2YZFKFf/aAK1F \
  7. Optional: Perform the following actions described in the following table to enable the additional features on Rational® Test Automation Server:
    Features Descriptions Action to be perform
    Service virtualization

    To enable services in the Istio Service Mesh to be virtualized as stubs

    Add the following parameter to the helm install command:
    --set execution.istio.enabled=true \
    --set execution.istio.clusterRoleBinding.create=true

    To enable the running of stubs that virtualize services in namespaces

    Add the following parameter to the helm install command:
    --set execution.istio.namespaces='{namespaceA,namespaceB}' \
    Alternatively, you can add the parameter to the helm install command by using an array index notation as follows:
    --set execution.istio.namespaces[0]=namespaceA \
     --set execution.istio.namespaces[1]=namespaceB 
    
    Jaeger

    To use Jaeger for performance and Web UI tests logs

    Set the following parameters in any of the following conditions:
    • When you have installed a Jaeger operator on the cluster or on the test-system namespace

    • When you did not enable to expose Jaeger UI during the Kubernetes setup

    Note: You must substitute {my-jaeger-dashboard-url} with the URL of the Jaeger server.
    --set global.jaegerDashboard.externalURL={my-jaeger-dashboard-url}
    --set global.jaegerAgent.internalHostName=localhost
    
    #If there is no Jaeger UI is available, then set the following parameters to false:
    --set global.jaegerDashboard.enabled=false
    --set global.jaegerAgent.enabled=false
    
    Postman

    To run Postman test assets that you created in the Postman application

    Add the following parameter to the helm install command:
    --set global.hclOneTestPostmanEnabled=true
    JMeter

    To run JMeter test assets and their associated variables and environments that you created in the desktop clients

    Add the following parameter to the helm install command:
    --set global.hclOneTestJmeterEnabled=true
    NodePort

    To run performance tests on the Static agents

    Add the following parameter to the helm install command:
    --set networkPolicy.enabled=false
  8. Run the following commands to install the server software on your computer:

    You must substitute the value of the following variables with the actual value in the command:

    • {my-ots} with the release name of your choice.

      Note: If you migrated user data from a previous release (V10.0.2, Fix Pack 1), then you must use the same {my-ots} name that you used in step 7a.
    • {my-ingress-dns-name} with the same ingress DNS name that displayed on completion of the ubuntu-init.sh script.

    • {my-super-secret} with a value of your choice.

      Important: This password seed is used to create several default passwords for the server. You must store the password seed securely. When you install the server software by using the backup of the user data, you can reuse the password seed. You can use this seed to restore backup files either on the current or later versions of the server software.
    • Optional: {cloud-license-server-url} and {cloud-license-server-id} with the URL and ID of the license server.

      Alternatively, you can configure the OneTest License Server ID and OneTest Server URL values from the Configure License window when the installation of the server is complete.

    #Make sure the repository is current and retrieve the charts required to install the server
    #You can skip the following two commands if you have migrated from the previous version (V10.0.2, Fix Pack 1 or earlier)
    helm repo update
    helm pull --untar hclsoftware/hcl-onetest-server --version 3.1012.0
    
    #Install the server
    helm install {my-ots} ./hcl-onetest-server -n test-system \
    -f hcl-onetest-server/values-k3s.yaml \
    --set global.hclOneTestIngressDomain={my-ingress-dns-name} \
    --set global.hclFlexnetURL={cloud-license-server-url} \
    --set global.hclFlexnetID={cloud-license-server-id} \
    --set global.hclImagePullSecret=hclcr.io \
    --set global.hclOneTestPasswordAutoGenSeed={my-super-secret}
    Tip: After you installed the server software, anytime if you want to enable or disable any specific features on Rational® Test Automation Server you can do so by using the helm upgrade command.
    For example, if you want to enable Postman feature to run Postman test assets that you created in the Postman application, you can run the following commands:
    helm upgrade {my-ots} -n test-system ./hcl-onetest-server \
    --reuse-values \
    --set global.hclOneTestPostmanEnabled=true
  9. Optional: Perform the following steps to restore the backed up user data from the current version:
    1. Stop Kubernetes by running the k3s-killall.sh command.
    2. Restore the backed-up user data by running the following commands:
      cd hcl-onetest-base
      sudo ./backup.sh restore [options] <backup-file-name>
      Note: You must replace <backup-file-name> with the name of the back up file that you saved.
    3. Restart Kubernetes by running the systemctl start k3s command to start Rational® Test Automation Server.
  10. Run the following command to verify and test the installed server software:
    $ helm test {my-ots} -n {namespace}
    where:
    • {my-ots} is the release name that you provide during the installation of the server software.
    • {namespace} is the name of the namespace that you created during the server installation process.

Results

On completion of the installation of server software, the output displays the following information on the command-line interface:
  • Instructions to access Keycloak to manage and authenticate users.

    You can use the username as keycloak and password can be retrieved by running the following command:
    kubectl get secret -n namespace onetest-keycloak-postgresql -o jsonpath="{.data.password}" | base64 --decode; echo 
    where:
    • onetest is a sub-domain name that you select for the server.
    • namespace is the name of the namespace that you created.
  • The URL to access the Rational® Test Automation Server UI.

What to do next