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
| Command | What it does | Time on a laptop |
|---|---|---|
make k8s-e2e-up | Creates 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-up | The above plus Chaos Mesh 2.8.8 in robotelos-nonprod. | about 1 more minute |
make test-k8s-e2e | The dev-to-prod journey across the two clusters and the single-cluster tests. | about 2 min |
make test-k8s-chaos | Partition, 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
| Fault | What held | Convergence afterwards |
|---|---|---|
| Partition agent to control plane, 20 s | the fleet kept serving its version; staleness was visible | 2.8 s |
| 1 s delay with jitter and loss | still converged | 10.7 s |
| Agent pod killed during a deployment | the replacement fetched everything | 0.4 s |
| Operator pod killed during a pool change | the pool came up and reported in sync | within 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
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.