#What you’ll learn
- 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 (Webdriver.io + 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.
#Required resources for one instance
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.
#Recommended requirements for performance audit
- 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|
#How to get a deployment scripts
All deployment scripts are distributed with Canarytrace docker images.
secret.yamlis example and contains credentials and endpoint for Elasticsearch and license (key:value). You can use together with
smoke-desktop-shipper.yamlis full example. Shipper send static files into AWS S3. Read more
smoke-desktop.yamlCanarytrace CronJob with desktop settings in smoke mode.
smoke-mobile.yamlCanarytrace CronJob with mobile settings in smoke mode.
user-journey.yamlCanarytrace CronJob in user-journey mode. More info
- Elasticsearch & Kibana and Canarytrace Installer are required for successful Canarytrace startup
#How to deploy Canarytrace
Canarytrace in mode smoke is maintenance free approach. You just enter list of landing pages and deploy into your Kubernetes. Each landing page must be separated by a semicolon.
- Open and edit
- Enter path for your docker image e.g.
Docker images in this documentation will not work - you must have a docker image with Canarytrace from us with licence. Contact us to obtain a docker image and license.
- Edit landing pages ( max. 5 URLs)
- Enter your license
- Setup Elasticsearch cluster path
- Deploy into your Kubernetes cluster
kubectl -n canarytrace create -f smoke-desktop.yaml
How to edit list of landing pages
- Get list of CronJobs
- Edit CronJob and scroll down to BASE_URL
- Edit collection of landing pages in BASE_URL and save changes
You can display your Canarytrace instances
kubectl --kubeconfig=~/canary/xxx.kubeconfig.yaml get pods
Filebeat logging all stdout and stderr streams from all Canarytrace docker containers in your cluster.
- All data from Filebeat are stored to
#Manually debuging Canarytrace
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
#How to run Filebeat
ELASTICSEARCH_HOSTand next environemnt variables.
kubectl create -f filebeat-kubernetes.yaml
You can check filebeat logs, that it doesn't contain any error messages
Get logs from container with filebeat
#Filebeat data browsing
- 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.
#Filebeat log viewer
- Kibana contains a built-in log viewer
- Open your Kibana > Observability > Logs
- Do you find mistake or have any questions? Please create issue, thanks 👍
- Have more questions? Contact us.