No description
  • TypeScript 51.8%
  • Python 24.7%
  • Makefile 23.5%
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christopher Spelt 2d6eea6313
Some checks failed
ci / typecheck (push) Has been cancelled
sync / sync-forgejo (push) Has been cancelled
Merge pull request #4 from MinBZK/updatecli_main_e620364bad7c798441570202b8eb35d1ce4d13b8005c90c095a1336f08d7fc12
⬆️(deps) Bump grafana/k6 version to 2.0.0
2026-06-03 09:11:32 +02:00
.github/workflows (workflow) add sync workflow to mirror repository to Forgejo 2026-06-01 11:23:27 +02:00
runs/nextcloud ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
scenarios/nextcloud ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
scripts (other) project setup 2026-05-21 16:28:39 +02:00
updatecli ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
.env.example ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
.gitignore (other) project setup 2026-05-21 16:28:39 +02:00
.gitlint (other) project setup 2026-05-21 13:30:31 +02:00
.pre-commit-config.yaml ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
CODE_OF_CONDUCT.md (other) project setup 2026-05-21 13:30:31 +02:00
CONTRIBUTING.md (other) project setup 2026-05-21 13:30:31 +02:00
LICENSE (other) project setup 2026-05-21 13:30:31 +02:00
Makefile ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
networkpolicy.yaml (tests) add loadtest setup 2026-05-22 09:28:36 +02:00
package-lock.json (tests) add loadtest setup 2026-05-22 09:28:36 +02:00
package.json (tests) add loadtest setup 2026-05-22 09:28:36 +02:00
publiccode.yml (other) project setup 2026-05-21 16:28:39 +02:00
README.md ♻️ (tests) apply ADR-MB-009 labels, parameterize resources, add CI + updatecli 2026-05-22 10:41:53 +02:00
SECURITY.md (other) project setup 2026-05-21 13:30:31 +02:00
testrun.yaml ⬆️(deps): Update grafana/k6 image 2026-06-01 09:45:51 +00:00
tsconfig.json (tests) add loadtest setup 2026-05-22 09:28:36 +02:00

mijn-bureau-loadtest

k6 load-test scenarios for the MijnBureau platform. Scenarios run in-cluster as TestRun CRs scheduled by the k6-operator.

Layout

scenarios/<app>/                 # k6 scripts (helpers prefixed `_`), shipped as a ConfigMap
runs/<app>/<scenario>.env        # per-scenario env vars (sourced before envsubst)
testrun.yaml                     # single TestRun template
networkpolicy.yaml               # per-namespace egress allow rules
Makefile                         # install / run / logs / clean
tsconfig.json + package.json     # TypeScript type-check (editor + pre-commit)

Adding a scenario: one .ts under scenarios/<app>/, one .env under runs/<app>/.

Prerequisites

  • Kubernetes cluster with the k6-operator installed
  • Helm, envsubst, GNU make
  • npm install for the TypeScript type-check (editor + CI; not used at runtime)

Setup

Per cluster

helm repo add grafana https://grafana.github.io/helm-charts
helm install k6-operator grafana/k6-operator \
  --version 3.13.0 \
  --namespace k6-operator-system \
  --create-namespace

Per namespace (defaults to loadtest)

make setup

Per app

make install-scenarios app=nextcloud

# Credentials Secret — keys vary per app, documented in scenarios/<app>/_auth.ts.
# Nextcloud needs a user + OCS app-password (Settings → Security → Devices & sessions):
kubectl create secret generic loadtest-nextcloud-credentials -n loadtest \
  --from-literal NEXTCLOUD_USERNAME='<user>' \
  --from-literal NEXTCLOUD_APP_PASSWORD='<app-password>'

Re-run install-scenarios after editing a scenario script.

Daily workflow

cp .env.example .env.local       # once per environment
source .env.local                 # once per shell

make run    app=nextcloud scenario=breaking-point
make logs   app=nextcloud scenario=breaking-point
make clean  app=nextcloud scenario=breaking-point

make help lists targets.

Reading results

  • upload-ladder uploads files of increasing size (64 KB → 128 MB) once each, producing a per-size latency baseline. The cliff for a typical Nextcloud is well above this range; expect 100% success and roughly linear scaling.
  • concurrency-ramp ramps from 1 to 100 concurrent VUs against a fixed 1 MB upload, looking for where Nextcloud (PHP-FPM workers, Postgres connection pool, MinIO write concurrency) starts shedding requests. The breaking point is the VU count at which http_req_failed climbs above 0 or http_req_duration_p95 jumps.

Visualising

Metrics ship to Prometheus via remote-write. Import the official k6 dashboard (ID 19665).

PROMETHEUS_RW_URL must accept remote-write. OpenShift's bundled prometheus-k8s does not (no --web.enable-remote-write-receiver); use Mimir/Thanos/Grafana Cloud or a sidecar Prometheus with the receiver flag enabled.

OpenShift notes

The TestRun's runner.securityContext only sets seccompProfile: RuntimeDefault; the restricted-v2 SCC mutator handles the rest (runAsUser/runAsNonRoot/capabilities) at admission. Do not add runAsNonRoot: true here — kubelet rejects the grafana/k6 image's non-numeric USER on clusters without that mutator (e.g. kind).

networkpolicy.yaml allows egress for DNS, intra-namespace 6565 (k6-operator starter↔runner), HTTPS (target apps + remote-write), and 9090 (sidecar Prometheus). Add a rule if your remote-write endpoint listens elsewhere.

Without make

source .env.local
source runs/<app>/<scenario>.env
envsubst < testrun.yaml | kubectl apply -n loadtest -f -
kubectl logs -n loadtest -l "k6_cr=$LOAD_TEST_NAME" -f --tail=200
kubectl delete testrun -n loadtest "$LOAD_TEST_NAME" --ignore-not-found

The Makefile is a thin wrapper that validates required env vars.