Paul Balogh
Developer Advocate, k6 OSS
@javaducky
Running distributed
load tests with k6
Overview
1
2
3
4
What is k6?
What is load testing?
Introducing the k6-operator
Where do we go from here?
â—Ź Formerly known as Load Impact
â—Ź Open Source since 2016
â—Ź ~18.5k Github Stars
● Promote “shift-left” testing
github.com/grafana/k6
â—Ź Acquired by Grafana in 2021
By bringing k6 and Grafana together, we enable teams
to radically improve the time to prevent, detect,
and remediate problems before they impact end users.
Raj Dutt
Grafana Labs CEO/Co-founder
A reliability testing tool.
Integration
Testing
Contract
Testing
k6: a reliability testing tool
Browser
Automation
(E2E)
Load
Testing
Functional
Testing
Chaos
Testing
Although it’s easy to get started with k6 [OSS] all on its
own, it really shines with its ease of integration into a
developer ecosystem.
Thoughtworks Technology Radar
April 2021
OSS is at the
heart of what
we do and
helps leave the
world a little
better than we
found it
CLI and API
designed for
automating
your tests with
pass/fail criteria
using JavaScript
syntax
A k6 engine
written in Go
making it one of
the the best
performing
tools available
Use Go(lang) code
to add support for
new outputs,
protocols, and
products from
within your test
scripts
OpenSource Scriptable Performant Extensible
k6: a reliability testing tool
JAVASCRIPT RUNTIME
GOJA (https://github.com/dop251/goja)
GO
xk6 EXTENSIONS
k6: a reliability testing tool
JAVASCRIPT
Overview
1
2
3
4
What is k6?
What is load testing?
Introducing the k6-operator
Where do we go from here?
Load testing is the process of putting demand on a system
and measuring its response.
The Internet
Knower of all things
â—Ź Performance testing == load testing
â—Ź It is only for large companies
â—Ź Is expensive to do
â—Ź Should only be in production
â—Ź Unnecessary if you have o11y
Myths about load testing
UX
Why do load testing today?
Why do load testing today?
SLOs
Proactively test
Common types of load tests
Average and Peak test
Soak test
Spike test
Breakpoint test
Constant Arrival Rate
Ramping Arrival Rate
Ramping VUs
Per VU iterations
Constant VUs
Shared iterations
Modeling your load tests
“Shape” activity with Executors
Overview
1
2
3
4
What is k6?
What is load testing?
Introducing the k6-operator
Where do we go from here?
Same k6 test script, multiple execution modes!
Custom Resource Definition (CRD) launcher
kubectl create cm test-scripts –from-file=script.js
k8s-worker-1 k8s-worker-2 k8s-worker-3 k8s-worker-4
57 configurable options → https://k6.io/docs/using-k6/k6-options/reference/
CLI flags
ENV variables
Script options
Default Config file
Order of preference
Worker nodes
Overview
1
2
3
4
What is k6?
What is load testing?
Introducing the k6-operator
Where do we go from here?
The “Golden Signals”
Network quality, Geolocation
Special events, Cyber attacks
Bugs, 500s, Security/Auth
Underprovisioning, Infra issues
Pre-production Production
Virtual User
traffic
Real User
traffic
Virtual User
traffic
System in
Pre-prod
System in
production
Proactively improve reliability
k6.io/slack grafana/k6 community.k6.io
Connect with Paul as
@javaducky or linkedin/in/pabalogh
Demonstration project available at
github.com/javaducky/demo-k6-operator
Thanks for participating!

Running distributed tests with k6.pdf