Skip to content

CICD-337 · Distributed load generation ​

Encyclopedia · Distributed systems and reliability testing · All snippets

Previous · CICD-336 · Next · CICD-338

1. Where it fits ​

  • Placement tests/k6-run.yaml.
  • Prerequisites disposable integration environment, synthetic traffic and controlled test faults.
  • Platforms local-lab.

2. Copy the snippet ​

yaml
apiVersion: k6.io/v1alpha1
kind: TestRun
metadata: {name: web-load}
spec:
  parallelism: 4
  script:
    configMap: {name: k6-script, file: load.js}

3. How it works ​

The TestRun points the operator at a load script and provisions parallel workers. Collect aggregate results without treating per-worker totals as comparable individual runs.

The operator fans out worker jobs using a shared script.

flowchart TD
  N1["TestRun and script"]
  N2["k6 operator"]
  N1 --> N2
  N3["First load worker"]
  N2 --> N3
  N4["Other load workers"]
  N2 --> N4
  N5["Aggregated measurements"]
  N3 --> N5
  N4 --> N5

4. Verify the result ​

Requires the k6 operator and a ConfigMap containing an authorized load test. Observe all worker Jobs and aggregate their metrics.

Validation syntax-validated (YAML parse). Status definitions.