Setting up a Kubernetes environment on Ubuntu

You can use the readily available scripts to set up a microk8s Kubernetes environment along with other configurations to install Rational® Test Automation Server software in the Ubuntu server.

Before you begin

Procedure

  1. Log in to the Ubuntu server as a non-root user.
  2. Run the following command to retrieve the case from IBM Cloud Pack repository:
    curl -o ibm-rtas-case-2.1011.0.tgz https://raw.githubusercontent.com/IBM/cloud-pak/master/repo/case/ibm-rtas-case-2.1011.0.tgz
  3. Run the following command to extract the case:
    tar xvf ibm-rtas-case-2.1011.0.tgz
  4. Run one of the following two sets of commands to install the Kubernetes environment:
    Note: The second option allows you to override the name of the Kubernetes domain that is created.
    • To install with the default name that is either based on IP address or fully qualified host name, run the following commands:

      $ cd ibm-rtas-case/inventory/ibmRtasBase/files
      $ sudo ./ubuntu-init.sh
    • To install by overriding the default name, run the following commands:

      $ cd ibm-rtas-case/inventory/ibmRtasBase/files
      $ sudo INGRESS_DOMAIN={rtas}.myorg.com ./ubuntu-init.sh
      where:
      • {rtas} is a sub-domain name that you select for the server.
      • myorg.com is a domain name of your organization.

    On completion of the scripts, the output displays the following information on the command-line interface:

    • The INGRESS_DOMAIN that is in use. This is the URL from where you can access Rational® Test Automation Server login page.

    • The DNS information that the Kubernetes cluster uses to resolve names.

    • Certificate Authority that you must be import into the browser to prevent certificate errors.

    • Instructions to confirm whether the Kubernetes environment has started.

    • 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 rtas-keycloak-postgresql -o jsonpath="{.data.password}" | base64 --decode; echo 
      where:
      • rtas is a sub-domain name that you select for the server.
      • namespace is the name of the namespace that you created.
    • Instructions to access Kiali to open product logs. You can use the username as kiali and password can be retrieved by running the following command:
      kubectl get secret --namespace istio-system kiali -o jsonpath='{.data.passphrase}' | base64 --decode; echo
  5. Perform one of the following to configure a firewall:
    • Run the following script to configure the firewall that allows traffic on cni0 and port 443:
      $ sudo ./ubuntu-firewall.sh
    • You must update the firewall that allows traffic on cni0 and port 443, if your Ubuntu server is already configured with the firewall.

  6. Optional: Run the following command to enable the Jaeger traces for performance and Web UI tests:
    $ ./service.sh expose jaeger
    Note:

    If you do not enable Jaeger, Rational® Test Automation Server produces text output in a microservice log file instead of Jaeger traces, when you run performance and Web UI test assets.

    Important:

    The Jaeger traces are not protected, thus, any information logged into the Jaeger server might be easily accessible by anyone who has or discovers the <server-url>/jaeger URL.

  7. Optional: Run the following command to enable the Prometheus server to monitor your system resources by using metrics data:
    $ ./service.sh expose prometheus
    Important:

    The Prometheus metrics are not protected, thus, any information logged into the Prometheus server might be easily accessible by anyone who has or discovers the <server-url>/prometheus URL.

Results

You have set up the Kubernetes environment on Ubuntu and you can now install the server software.

What to do next

  • You must log in again to the server host system after the installation process completes so that changes to the group membership are applied.

  • You can run the kubectl get pods -A command to verify that the Kubernetes environment is working. After a while, the status of the pods must be Running state.

  • You must install the server software. See Installing the server software on Ubuntu using microk8s.