Network configuration
When deploying an Allure TestOps instance, you need to decide on:
- the external address (host and port) which the users will use to access Allure TestOps in their browsers,
- the listening port on which the Allure TestOps will listen to HTTP requests.
A production deployment usually relies on a reverse proxy or a load balancer that makes sure that user requests to the external address are routed to the listening port.
By default, Allure TestOps uses the unencrypted HTTP protocol. However, with a reverse proxy or a load balancer, it is possible to enable HTTPS.
It is common to have the testops service listening to port 8080 and a reverse proxy or a load balancer listening to port 443. The HTTPS requests on port 443 are being translated to HTTP requests on port 8080, then Allure TestOps processes them and responds to them. Where necessary, it uses the external address for generating cross-page links.
Common network parameters
Unlike other deployment methods, Kubernetes provides an integrated reverse proxy or a load balancer (Ingress or Istio). It listens to port 80 (or port 443 if HTTPS is enabled) and routes the requests to the listening port of the testops service.
Define the parameters in the values.yaml file:
instanceFqdn— Domain Name (DN) of Allure TestOps instance used by the end users and integrations;port— listening port (8080 by default);network.ingress.enabled— set totrueto use Ingress;network.istio.enabled— set totrueto use Istio.
For example, with the configuration below, the users will access the instance as http://testops.example.com (port 80), where Ingress will receive the requests and send them to the testops service (port 8080).
instanceFqdn: testops.example.com
port: 8080
# ...
network:
ingress:
enabled: true
Note that it is required to enable either Ingress or Istio, but not both.
Define the parameters in the .env file:
TESTOPS_INSTANCE_URL— Domain Name (DN) of Allure TestOps instance used by the end users and integrations;TESTOPS_INSTANCE_PORT— external port of the application container;TESTOPS_CONTAINER_PORT— port on which the application runs inside the container.
For example, with the configuration below, the users will access the instance as http://testops.example.com, assuming a reverse proxy will route the requests from the default port 80 to port 8080:
TESTOPS_INSTANCE_URL=testops.example.com
TESTOPS_INSTANCE_PORT=80
TESTOPS_CONTAINER_PORT=8080
When deploying using DEB or RPM packages, port 8080 will always be used for listening. In the /opt/testops/conf/testops.conf file, define the external host and port via the ALLURE_ENDPOINT parameter, specifying the full external URL.
For example, with the configuration below, the users will access the instance as http://testops.example.com, assuming a reverse proxy will route the requests from the default port 80 to port 8080:
ALLURE_ENDPOINT=http://testops.example.com
Reverse proxy parameters
This is the most overlooked place in the configuration stage that can severely affect the user experience and working with automated tests.
When setting up a reverse proxy for Allure TestOps, make sure the following parameters are configured correctly:
maximum size for a request body (for example,
client_max_body_sizein nginx);Set this parameter to 300 MB or higher. A lower limit may prevent uploading test results to Allure TestOps.
server response timeout (for example,
proxy_read_timeoutin nginx);Set this parameter to 300 seconds or higher. A lower timeout may interrupt uploading of test results to Allure TestOps.
forwarded headers (for example,
proxy_set_headerin nginx).Pass the original host and scheme to Allure TestOps. Without them, URLs generated by Allure TestOps, for example the server URL in Swagger UI, use
httpeven when users open Allure TestOps over HTTPS. Example for nginx, where theproxy_passaddress depends on your deployment:location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }
Enabling HTTPS
Both Ingress and Istio can work via the HTTPS protocol when provided with a valid TLS certificate. No external reverse proxy is needed.
Edit the parameters in the values.yaml file:
network.tls.enabled— must betrue;network.tls.secretName— the name of a Kubernetes secret that stores a TLS certificate.
For example:
host: testops.example.com
gateway:
service:
port: 8080
# ...
network:
ingress:
enabled: true
tls:
enabled: true
secretName: testops-tls
To enable HTTPS for a Docker Compose installation, set up a reverse proxy, such as nginx.
Then, open the .env file and update the following parameters:
- Change
TESTOPS_PROTOfromhttptohttps. - Change
TESTOPS_INSTANCE_PORTfrom80to443.
For example:
TESTOPS_PROTO=https
TESTOPS_INSTANCE_URL=testops.example.com
TESTOPS_INSTANCE_PORT=443
TESTOPS_CONTAINER_PORT=8080
To enable HTTPS when using DEB or RPM packages, set up a reverse proxy, such as nginx.
Then, open the /opt/testops/conf/testops.conf file and update the ALLURE_ENDPOINT parameter by changing http to https.
For example:
ALLURE_ENDPOINT=https://testops.example.com
Using a proxy for outgoing connections
If your network allows Allure TestOps to reach external services, such as issue trackers, CI systems, or identity providers, only through a corporate proxy, configure the proxy with the standard Java system properties.
The Helm chart has a proxy section in the values.yaml file:
proxy:
enabled: true
proxyHost: proxy.example.com
proxyPort: 3128
nonProxy: localhost|127.*|10.*|172.16.*|*.local|*.corp.example.com
noProxy: localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,.local,.corp.example.com
The parameters are:
proxy.enabled: set totrueto use the proxy;proxy.proxyHostandproxy.proxyPort: the proxy for bothhttp://andhttps://addresses;proxy.nonProxy: the hosts that Allure TestOps connects to directly, bypassing the proxy, in the Java format. Separate the hosts with|, and use*only at the beginning or at the end of a host name;proxy.noProxy: the same exclusions in the format of theNO_PROXYenvironment variable. Separate the entries with commas, specify networks in the CIDR notation, and domains with a leading dot, for example,.corp.example.com.
With proxy.enabled: true, the chart passes the proxy to the Java properties in JAVA_TOOL_OPTIONS and to the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables of the container. Keep nonProxy and noProxy consistent, so that both lists exclude the same hosts.
The chart also sends the connections to the SMTP server through the proxy, and the exclusions don't apply to them. If your SMTP server is reachable only directly, make sure that the proxy can forward the connections to it.
Apply the changes:
helm upgrade testops qameta/testops --namespace testops -f values.yaml
To make sure that Java has received the options, look for them in the log. Java prints them at start:
kubectl logs -n testops deployments/testops-testops | grep "Picked up JAVA_TOOL_OPTIONS"
In the docker-compose.yml file, find the testops service and add the proxy properties to JAVA_TOOL_OPTIONS in its environment section:
services:
testops:
# ...
environment:
# ...
JAVA_TOOL_OPTIONS: >
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:MinHeapFreeRatio=15
-XX:MaxHeapFreeRatio=30
-Dsun.jnu.encoding=UTF-8
-Dfile.encoding=UTF-8
-Dhttp.proxyHost=proxy.example.com
-Dhttp.proxyPort=3128
-Dhttps.proxyHost=proxy.example.com
-Dhttps.proxyPort=3128
-Dhttp.nonProxyHosts=localhost|127.0.0.1|*.corp.example.com
The properties are:
http.proxyHostandhttp.proxyPort: the proxy forhttp://addresses;https.proxyHostandhttps.proxyPort: the proxy forhttps://addresses, usually the same proxy;http.nonProxyHosts: the hosts that Allure TestOps connects to directly, bypassing the proxy. The list applies to bothhttp://andhttps://addresses. Separate the hosts with|, and use*only at the beginning or at the end of a host name.
Docker Compose substitutes variables from the .env file into docker-compose.yml, so you can keep the proxy values together with the other deployment parameters. Add the variables to the .env file:
PROXY_HOST=proxy.example.com
PROXY_PORT=3128
NON_PROXY_HOSTS=localhost|127.0.0.1|s3.corp.example.com|jira.corp.example.com
Use them in JAVA_TOOL_OPTIONS:
JAVA_TOOL_OPTIONS: >
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:MinHeapFreeRatio=15
-XX:MaxHeapFreeRatio=30
-Dsun.jnu.encoding=UTF-8
-Dfile.encoding=UTF-8
-Dhttp.proxyHost=${PROXY_HOST}
-Dhttp.proxyPort=${PROXY_PORT}
-Dhttps.proxyHost=${PROXY_HOST}
-Dhttps.proxyPort=${PROXY_PORT}
-Dhttp.nonProxyHosts=${NON_PROXY_HOSTS}
Keep in mind:
- Don't use spaces or quotes in the values. The
>block joins the lines with spaces, and Java splitsJAVA_TOOL_OPTIONSinto separate options by spaces. - Use the Java properties, not environment variables. Setting
HTTP_PROXY,HTTPS_PROXY, orNO_PROXYfor the container doesn't configure the proxy for Allure TestOps. - The SMTP server is not affected. Allure TestOps connects to it directly.
Recreate the container to apply the changes:
docker compose up -d
To make sure that Java has received the options, look for them in the log. Java prints them at start:
docker compose logs testops | grep "Picked up JAVA_TOOL_OPTIONS"
In the /opt/testops/conf/testops.conf file, add the proxy properties to the end of the JAVA_TOOL_OPTIONS value, inside the quotes:
JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:+UseStringDeduplication -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8 -Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=3128 -Dhttp.nonProxyHosts=localhost|127.0.0.1|*.corp.example.com"
The properties are:
http.proxyHostandhttp.proxyPort: the proxy forhttp://addresses;https.proxyHostandhttps.proxyPort: the proxy forhttps://addresses, usually the same proxy;http.nonProxyHosts: the hosts that Allure TestOps connects to directly, bypassing the proxy. The list applies to bothhttp://andhttps://addresses. Separate the hosts with|, and use*only at the beginning or at the end of a host name.
Keep in mind:
- Keep the whole value on one line in double quotes. Separate the options with spaces, and don't use spaces inside the values.
- Use the Java properties, not environment variables. The testops service takes its environment only from testops.conf, so
HTTP_PROXY,HTTPS_PROXY, orNO_PROXYset in your shell or in the system don't configure the proxy for Allure TestOps. - The SMTP server is not affected. Allure TestOps connects to it directly.
Restart the service to apply the changes:
sudo systemctl restart testops
To make sure that Java has received the options, look for them in the log. Java prints them at start:
sudo journalctl -u testops | grep "Picked up JAVA_TOOL_OPTIONS"
What to take into account
- Add internal services to the exclusions. List every service in your network that Allure TestOps connects to over HTTP or HTTPS: the S3 storage, self-hosted issue trackers and CI servers, the identity provider. Otherwise Allure TestOps sends these requests to the proxy, and they may fail.
- Keep
localhostin the exclusions. Your list replaces the default Java list, which containslocalhost,127.*, and[::1]. - Allow access without credentials. The standard Java properties have no proxy user name and password, so configure the proxy to accept connections from Allure TestOps without authentication.
- Database and other internal connections are not affected. The proxy properties apply only to HTTP and HTTPS. Allure TestOps connects to PostgreSQL, RabbitMQ, Redis, and LDAP directly.
Checking the connection
Open the settings of an integration with an external service and click Test connection.
Configuring firewall
If you are using a firewall, make sure that incoming traffic is allowed.
This step may be done in different ways, depending on the firewall you use. Below are examples for the default firewalls in different Linux distributions. Please be sure to replace 8080 with the relevant port for your deployment.
sudo ufw allow 8080/tcp
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload