Run it locally on Kubernetes

Two kind clusters, an optional Chaos Mesh, and the make targets that drive them.

You need Docker, go, kind and kubectl; chaos also needs helm. On macOS: brew install kind kubectl helm. Nothing is installed for you, and the script names a missing tool.

make test-k8s-envtest    # real kube-apiserver and etcd, no nodes (about 10 s)
make test-k8s-e2e        # create the two kind clusters if missing, run the kind tests
make test-k8s-chaos      # add Chaos Mesh to the nonprod cluster, run the chaos test
make k8s-e2e-down        # delete both clusters
CommandWhat it doesTime on a laptop
make k8s-e2e-upCreates robotelos-nonprod (dev, stg) and robotelos-prod (prod), builds and loads the images, installs the CRD, RBAC and operator.about 1.5 min the first time, seconds after
make k8s-chaos-upThe above plus Chaos Mesh 2.8.8 in robotelos-nonprod.about 1 more minute
make test-k8s-e2eThe dev-to-prod journey across the two clusters and the single-cluster tests.about 2 min
make test-k8s-chaosPartition, delay, loss, agent pod kill, operator pod kill.about 1 min

The control plane, PostgreSQL and the data databases run in the test process on the host. The tests accept only kind- contexts, and the script restores your current kubectl context after creating a cluster.

Load and soak tests of the Platform API

make test-load    # 24 concurrent clients, p95 limit per endpoint, consistency afterwards
make test-soak    # moderate load for 40 s while connections are killed and the API restarts

Known finding: the overview endpoint is the slow one (p95 about 1.8 s at 140 agents) because the client makes one call per agent and environment. A server-side read model is planned.

Chaos results

FaultWhat heldConvergence afterwards
Partition agent to control plane, 20 sthe fleet kept serving its version; staleness was visible2.8 s
1 s delay with jitter and lossstill converged10.7 s
Agent pod killed during a deploymentthe replacement fetched everything0.4 s
Operator pod killed during a pool changethe pool came up and reported in syncwithin the test wait

Limits

  • The agent pod reaches the host as host.docker.internal, which Docker Desktop provides. Linux with Docker Engine needs a host-gateway mapping that is not set up.
  • Chaos Mesh is installed in the nonprod cluster only.
  • The kind and chaos suites are not run in CI yet.

Next steps