Setting up a Kubernetes environment on Ubuntu
You can use the readily available scripts to set up a k3s Kubernetes environment along with other configurations to install HCL OneTest™ Server software in the Ubuntu server.
Before you begin
-
You must ensured that you have installed the following software:
-
OpenSSH server
-
Helm
-
-
You must ensure that your computer has a static IP address or Domain Name Server (DNS) resolvable host name to resolve host name into a machine-readable IP address.
-
You must have copied a Secret key from the Harbor repository.
Procedure
- Log in to the Ubuntu server as a non-root user.
-
Add the software registry to Helm by running the following command:
Note: 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.helm repo add hclsoftware https://hclcr.io/chartrepo/ot --username {okta-email-address} --password {harbor-cli-secret}
-
Run the following command to get the latest updates from the repository:
helm repo update
-
Run the following commands to fetch the scripts that are used to install
Kubernetes:
helm pull --untar hclsoftware/hcl-onetest-base --version 3.1012.0 chmod +x hcl-onetest-base/*.sh
-
Run any of the following commands to install the Kubernetes environment:
Note: The second option allows you to override the name of the Kubernetes domain that is created.
-
Run the following commands to install with the default name that is either based on IP address or fully qualified host name:
#Run the following commands if you are on Ubuntu 18.04 $ cd hcl-onetest-base $ sudo ./ubuntu-init.sh #Run the following commands if you are on Ubuntu 20.04 $ cd hcl-onetest-base $ sudo HOME=$HOME ./ubuntu-init.sh
-
Run the following commands to install by overriding the default name:
$ cd hcl-onetest-base $ sudo INGRESS_DOMAIN={onetest.}myorg.com ./ubuntu-init.sh
where:-
{onetest.} is a sub-domain name that you specified for the server. For example, testenv.Note: The sub-domain must consist of lowercase alphanumeric characters,
-
(hyphen) or.
(period). Also, the value must start and end with an alphanumeric character. -
myorg.com is a domain name of your organization. For example, hcl.com
-
You can access the product through a web browser by using any of the following ways:-
Fully Qualified Hostname: When the server is configured, you can use
hostname -f
command to get the fully qualified hostname defined in the DNS to access HCL OneTest™ Server. For example, {onetest}.myorg.com -
IP address: You can use the IP address to access HCL OneTest™ Server when you cannot create a specific DNS record for the server. For example, ip-address.nip.io
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 HCL OneTest™ Server. You must use this value for the global.hclOneTestIngressDomain parameter in the step 8 in the server installation topic.
-
The DNS information that the Kubernetes cluster uses to resolve names.
-
Certificate Authority (CA) certificate that you must be import into the browser to prevent certificate errors.
-
Instructions to confirm whether the Kubernetes environment has started.
-
-
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:
#Run the following command if you are on Ubuntu 18.04 $ sudo ./ubuntu-firewall.sh #Run the following command if you are on Ubuntu 20.04 $ sudo HOME=$HOME ./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.
-
- 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, HCL OneTest™ 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. - 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
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 can install the server software. See Installing the server software on Ubuntu by using k3s.