- What is Kubernetes
- Why we use Kubernetes
- What are the recommendation on resources requirements
Canarytrace is designed for use in Kubernetes and this has many advantages:
- Canarytrace isn't testing framework, but complete test stack with additional components.
- Designed for pattern 1:1:1 (= 1 monitor script, 1 Canarytrace runner, 1 instance of a browser) - due to strict isolation and predictable resource allocation for each run, the results are credible and comparable.
- Many tasks are delegated to a lower level, on Kubernetes. It's a better approach than to solve all tasks on the testing framework level. Each Canarytrace component has its own responsibility. E.g.
- Canarytrace runner (WDIO + services) only loads, runs of test scripts and live reporting
- Elasticsearch stack for storing all data from Canarytrace runner and such as engine for agregate data for test report, backups, trends etc.
- Beats are small datashippers and we use Beats for collect all logs from our docker containers.
- Kibana for data analysis and visualizations from Canarytrace runner, for the preparation of a test report in many forms e.g. report for testers, architect, devops or test manager.
- Canarytrace Listener for automatically analyzing many types of data scanned from a browser, alerting by thresholds to many services such as slack or email, simplification of the test result for integration with other tools such as Zabbix.
- Kubernetes parallelizes, guarantees, manages and isolates each instance of the Canarytrace runner. Every instance of Canarytrace starts on the same conditions. This is an advantage because the tests don't affect each other.
- We no longer need tools like Jenkins or Selenium cluster.
- Thanks to Kubernetes you are not vendor locked and at the same time Canarytrace can be run on AWS, DigitalOcean, Azure Cloud, GCE or on your VPS.
Requirements on resource will be higher if you will be perform a performance audit. Without performance audit will be perform availability check and download information about network trafic in a browser.
- Loading web pages into a modern browser is not an easy task. The measurement results may be skewed by insufficient resources and therefore the following settings are recommended for performance audit.
- Minimum 2 dedicated cores (4 recommended)
- Minimum 2GB RAM (4-8GB recommended)
- One instance = one monitor script
- Resource units in Kubernetes
|Resources||CPU requests||CPU limits||Memory requests||Memory limits|
Check resource quota on all nodes
beatscontains filebeat deployment scripts for backup live logging stdout of all docker images of Canarytrace
k8scontains Kubernetes deployment scripts of Canarytrace
Canarytrace Smoke is a free edition and you can use it for study of web performance testing
- Install Terraform CLI
- Deploy Kubernetes objects via Terraform
- first step is create namespace
- setup path to git repository, WDIO log.level, wait.for.timeout for all waitFor* methods and allow the use of the services
- setup for AWS S3 such as access.key, secret.key, region and bucket
- setup for live logging to elasticsearch such as cluster and http.auth
- setup USERNAME and PASSWORD for logging to tested application
Create secret with your id_rsa_no_pass for clone private git repository
Deploy CronJob with your monitor script
Update environment variables of the deployment script with your monitor script
image: rdpanek/canarytrace:c.2.9.31set latest tag of docker image with Canarytrace Professional or use your private docker repository
- set revision of test in your git repository
- set name of test case
- set URI of tested application
All values for other environment variables are provided via
Filebeat logging all stdout and stderr streams from all Canarytrace docker containers in your cluster.
- All data from Filebeat are stored to
For manually debuging Canarytrace runner and other components in a docker containers - you can use command line tool kubectl for tail stdout and stderr streams from all containers in your Kubernetes cluster or Lens
This is easy for learning and maintanance Canarytrace containers, but not but not effective.
- Show all logs in a Kibana in real time - access to logos without knowledge with kubectl tool
- Searching events, errors and other strings in a streams
- Filtering by name of docker container
- Create visualizations from events
- Create alerting from events in a log by conditions
- Download deployment script for Filebeat
deployments/beats/filebeat-logging.yamlfrom Canarytrace Professional and Canarytrace Smoke Pro docker container
- Edit elasticsearch connection params
kubectl apply -f deployments/beats/filebeat-logging.yaml
You can check filebeat logs, that it doesn't contain any error messages
Get logs from container with filebeat
- Open your Kibana > Discover and index
kubernetes.container.name : canarydisplay stdout and stderr streams from Canarytrace runner docker container.
message: "testStepStart: HomePage open"for display all record which contains this string.
- Kibana contains a built-in log viewer
- Open your Kibana > Observability > Logs