Installing the server software on Red Hat OpenShift

You can install Rational® Test Automation Server on the Red Hat OpenShift server that has the Kubernetes Engine 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

You must have completed the following tasks:

About this task

As part of the installation process, you might optionally migrate user data from a previous version of the product, or restore a backup of user data from the current version of the product. You must perform different steps, depending on which version of the user data backup file you are applying during the install. For more details, see the following table:

Backed up user data from To restore
Rational® Test Automation Server V10.0.2, Fix Pack 1 or earlier Perform the step 6 and 7.
Rational® Test Automation Server V10.1.0 Perform the step 10.

Procedure

  1. Open and log in to the terminal.
  2. Create a namespace to install the server software by entering the following command:
    oc new-project test-system
  3. Add the repository to Helm to access the server install charts by entering the following command:
    helm repo add ibm-helm https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm
  4. Run the following command to get the latest updates from the repository:
    helm repo update
  5. Create a secret to pull images that are used by Rational® Test Automation Server by entering the following commands:
    Notes:
    • You must substitute {api-key} with your key for the cloud.ibm.com repository.

    • You can replace the not-required@test with the administrators email address, if desired.

    oc create secret docker-registry cp.icr.io \
      -n test-system \
      --docker-server=cp.icr.io \
      --docker-username=iamapikey \
      --docker-password={api-key} \
      --docker-email=not-required@test
  6. Optional: Run the following commands to start a pod that assists you in migrating user data:
    #Retrieve the backup yaml file
    curl  -Lo ibm-rtas-prod.tgz https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm/ibm-rtas-prod-1.101.0.tgz
    
    #Extract the file
    tar xvf ibm-rtas-prod.tgz
    
    #Modify the backup yaml file with the release name for your server by replacing {my-rtas}
    sed -i 's/{{ \.Release\.Name }}/{my-rtas}/g' ibm-rtas-prod/files/import-prek8s-backup.yaml
    
    #Update the runAsUser to match scc policy
    sed -i -e "s/1001/$(oc get project test-system -oyaml \
      | sed -r -n 's# *openshift.io/sa.scc.uid-range: *([0-9]*)/.*#\1#p')/g" ibm-rtas-prod/files/import-prek8s-backup.yaml
    
    #Add the fsGroup settings
    sed -i 's/\(.*\)\(runAsUser:\)\(.*\)/\1\2\3\n\1fsGroup:\3/' ibm-rtas-prod/files/import-prek8s-backup.yaml
    
    #To fix slow network issues
    sed -i 's/sleep 5/sleep 30/' ibm-rtas-prod/files/import-prek8s-backup.yaml
    
    #Apply the backup yaml file to start the import-prek8s-backup pod
    oc apply -f ibm-rtas-prod/files/import-prek8s-backup.yaml -n test-system
  7. Optional: Run the following command to display the import-prek8s-backup pod's log, and then follow the instructions in the log to copy your backup file to where the pod is waiting to process it:
    oc logs import-prek8s-backup -n test-system

    When the user data backup is fully migrated, the import-prek8s-backup pod changes from Running to Completed state. To view the pod state you can run the oc get pod import-prek8s-backup -n test-system command.

    Progress can be monitored by displaying the log to check for updates. When the state of the pod is Completed, the log file displays the additional parameters that must be added to the helm install in step 8. The following is an example that shows the additional helm arguments:
    --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 \
  8. Run the following commands to install the server software on your computer:
    Notes:
    • You must substitute the following variables value with the actual value in the command:

      • {my-rtas} with the release name that you provided for the server.

      • {openshift-cluster-dns-name} with the remainder of the DNS name you selected for the server.

      • {rlks-ip-address} with the IP address of the Rational License Key Server.

      • {my-super-secret} with a password seed that you selected.

      • {namespace} with the name of the namespace that you created.

    • The password seed is used to create all other default passwords. You must store the password seed securely. The password seed is reused when you install the server software by using a backup of user data. This seed is used when restoring backup files either on the current or later versions of the server software.

    • If you migrated user data from a previous release, you must use the same {my-rtas} name that you chose then, during the install step.

    • The default storage class must support both the ReadWriteOnce (RWO) and ReadWriteMany (RWX) access modes. If the default storage class does not support ReadWriteMany (RWX), you must add the following parameter to the helm install command:
      --set execution.userlibs.persistence.storageClass=ibmc-file-bronze
    #Make sure the repository is current, and retrieve the charts required to install the server
    helm repo update
    helm pull --untar ibm-helm/ibm-rtas-prod --version 1.101.0
    
    #Update the runAsUser and fsGroup to match scc policy
    sed -i -e "s/runAsUser: 1001/runAsUser: $(oc get project test-system -oyaml \
      | sed -r -n 's# *openshift.io/sa.scc.uid-range: *([0-9]*)/.*#\1#p')/g;
               s/fsGroup: 1001/fsGroup: $(oc get project test-system -oyaml \
      | sed -r -n 's# *openshift.io/sa.scc.supplemental-groups: *([0-9]*)/.*#\1#p')/g" ibm-rtas-prod/values-openshift.yaml
    
    #Install the server
    helm install {my-rtas} ./ibm-rtas-prod -n test-system \
      --set license=accept \
      -f ibm-rtas-prod/values-openshift.yaml \
      --set global.ibmRtasIngressDomain=rtas.apps.{openshift-cluster-dns-name} \
      --set global.rationalLicenseKeyServer=@{rlks-ip-address} \
      --set global.ibmRtasPasswordAutoGenSeed={my-super-secret} \
      --set global.ibmRtasRegistryPullSecret=cp.icr.io \
      --set keycloak.keycloak.image.pullSecrets[0]=cp.icr.io
    
    Optionally, to enable virtual services to use the RedHat Service Mesh, complete the following two steps:
    1. Add the following parameter to the helm install parameters in the preceding command before installing the server:
      --set execution.istio.enabled=true
    2. Run the following command to create the role bindings required for Istio:
      oc create rolebinding istio-virtualization-enabled -n {namespace} --clusterrole={my-rtas}-execution-istio-test-system --serviceaccount=test-system:{my-rtas}-execution 
      Note: When you uninstall the chart, the manually created role bindings are not deleted from the namespace.
  9. Optional: Set the following parameters, if you have installed a Jaeger operator on the cluster and you want to use it for performance and Web UI tests logs:
    --set-string execution.annotations.sidecar\\.jaegertracing\\.io/inject=true
    --set global.jaegerAgent.enabled=true
    --set global.jaegerAgent.internalHostName=localhost
    --set global.jaegerDashboard.enabled=true
    --set global.jaegerDashboard.externalURL={my-jaeger-dashboard-url}
    Note: You must substitute {my-jaeger-dashboard-url} with the URL of the Jaeger server.
  10. Optional: Run the following command to restore the backed up user data from the current version:
    velero restore create --from-backup=<backup-name> --restore-volumes
    Note: You must replace <backup-name> with the name of the back up file that you saved.
  11. Optional: Run the following command to verify and test the installed server software:
    $ helm test {my-rtas} -n {namespace}
    where:
    • {my-rtas} with the release name that you provided for the server.
    • {namespace} is a name of the namespace that you created during the server install.

Results

On successful installation of Rational® Test Automation Server, the output displays the URL to access the Rational® Test Automation Server UI.

What to do next