grafana / k6-operator

An operator for running distributed k6 tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor `TestRun` controller

yorugac opened this issue · comments

Historically, k6-operator has been quite a straight-forward project (as far as Kubernetes operators go) and pretty straight-forward to maintain or to work with. But recently, it has been becoming more complex, esp. with the work on idempotence problem and recent addition of PrivateLoadZone feature. TestRun controller especially is quite unwieldy now, and refactoring is in order.

The main goals are:

  • improve readability
  • simplify maintenance effort
  • extend our unit tests coverage

On solution. There is no "standard" way to implement Kubernetes operators. And our particular operator is quite heavy on custom logic which does not make sense to persist as Kubernetes resources at this point of time. Still, it is just the code. One way to simplify it is to write a framework, specifically for this operator. Another way is to find an existing solution. After conducting research and trying out different PoC's, it appears that we are not the first to encounter a similar problem and it makes sense to try to use an existing library.

This is a large task and it will be split into separate PRs. The list of PRs will be updated here.