The k6 Kubernetes Job fails with `The moduleSpecifier "/scripts/test.js" couldn't be found on local disk`.

BeginnerTroubleshootingk6 Load Testing
Answer

Likely causes → The ConfigMap with the script is not mounted, mounted at a different path, or the key name differs from test.js.

Diagnose →

kubectl get cm -n loadtest k6-script -o yaml | head -20
kubectl get job -n loadtest k6-run -o yaml | yq '.spec.template.spec.volumes, .spec.template.spec.containers[0].volumeMounts'

Fix → Create the ConfigMap with the expected key (kubectl create configmap k6-script --from-file=test.js) and mount it at /scripts.

Prevent → Use the k6 Operator TestRun resource, which handles script ConfigMaps consistently.

All SRE & Reliability questions Roadmap: SRE & incident response

More on k6 Load Testing