Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locust k8s operator #2188

Closed
AbdelrhmanHamouda opened this issue Sep 8, 2022 · 17 comments
Closed

locust k8s operator #2188

AbdelrhmanHamouda opened this issue Sep 8, 2022 · 17 comments

Comments

@AbdelrhmanHamouda
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Need for flexible, secure and easy to use distributed performance testing solution while enabling keeping in mind points like; cloud governance, k8s resource management, CI compatibility.

Describe the solution you'd like

A k8s operator

Describe alternatives you've considered

HELM. However, this is not optimal as it requires a lot of manipulation and dealing with a lot of different k8s resource types not to mention lack of governance when deployed in an organisation.

Additional context

In my company, we were interested in cloud based distributed performance testing. We ended up choosing “locust” as a tool and I wrote a kubernetes operator for it. As far as I know and searched, this simply doesn’t exist for locust today.The operator have been running on AWS EKS for months now and it is very stable and performant.

The project was created to provide:

  • A friendly user interface "A simple k8s custom resource based on a CRD"
  • Ability to run a distributed performance testing
  • Only ask for needed cluster permissions (security)
  • Exposing a Prometheus endpoint for test metrics
  • Maintain cloud infrastructure governance i.e. when used in an organisation, it is possible to maintain the governance over the allocated / created resources.
  • Cloud native by design
  • Enablement of performance testing in CI / CD pipelines

The project was inspired after doing an industry study / survey.
The project was influenced in functionality by the k6 k8s operator.

As the code really doesn't include anything exclusive to the company, Open sourcing it is not a problem and it is something that I would happily do.

What is the "catch"?
The only "catch" is that the project is written in Java. That being said, from a user perspective, the interface purely through k8s and users are not exposed to any java code. This is similar to how k8s and most operators are written in Go but non of k8s users need to know anything about Go.

Looking forward to your feedback.

@cyberw
Copy link
Collaborator

cyberw commented Sep 8, 2022

Sounds like a great thing! If you publish it in your own repo, I’ll happily link it from the documentation, like with the helm stuff. https://docs.locust.io/en/stable/running-in-docker.html

@OneCricketeer
Copy link

OneCricketeer commented Sep 8, 2022

I see you listed Helm as an alternative, but that doesn't really address other solutions to run distributed load tests such as k6 on k8s

EDIT: Which I do see you listed as an inspiration.

@AbdelrhmanHamouda
Copy link
Contributor Author

Before selecting Locust, we actually did a market study to see which tool would best fit our needs. K6 was on the table and it almost made the cut if i'm being honest. However "and this is a big one", when it came down to distributed performance testing, locust was much better with supporting functionality that come out of the box. k6 "at least at the time of the study" was really focused on single instance tests.

@AbdelrhmanHamouda
Copy link
Contributor Author

@cyberw, I'm gonna be working on Open sourcing the project in the coming period. It might take me a minute as i'm doing this alone but should be possible.

@cyberw
Copy link
Collaborator

cyberw commented Sep 10, 2022

Awesome!

@AbdelrhmanHamouda
Copy link
Contributor Author

Hello @cyberw,
The work is ongoing for the operator.
One of my aims and goals are to have this operator act & "feel" like a natural extension of locust. So users of the tool can feel right at home when extending their usage to the cloud with the operator. To that extent, would it be possible to have you for a short call (or any other form of your preferred communication method) to share the methodology and approach with you and see if they are indeed aligned.

@cyberw
Copy link
Collaborator

cyberw commented Sep 19, 2022

Maybe you can show me what you have right now and we'll have a chat then? My colleague @DennisKrone is looking at running our stuff in k8s right now. At the moment we use locust-swarm (plain servers, no k8s/docker stuff), but he's looking at the helm chart right now, and I think we'd both be interested in seeing what you've done.

@AbdelrhmanHamouda
Copy link
Contributor Author

The full docs are still work in progress.. However, i can put together a short "how does it work".md + short demo video. would that be enough to get things started?

@AbdelrhmanHamouda
Copy link
Contributor Author

AbdelrhmanHamouda commented Sep 26, 2022

@cyberw , @DennisKrone, I have put together most parts of the essential documentation needed.
The project is available at: locust-k8s-operator
How does it work; demo available here

As i mentioned earlier "One of my aims and goals is to have the operator act & "feel" like a natural extension of locust. So users of the tool can feel right at home".

looking forward to hear your take on it.

@DennisKrone
Copy link
Collaborator

Sorry for the delay. I'll take a look!

@vitobotta
Copy link

Hi @AbdelrhmanHamouda ! This looks amazing! I checked the docs and would like to give it a try. How do I open the UI when a test is running?

@AbdelrhmanHamouda
Copy link
Contributor Author

Hello @vitobotta, Thank you for taking interest in the project. Your question have 2 answers one for getting started and another for doing things "properly";

  • The proper way to see the results is to setup a Prometheus server and a metric visualisation tool e.g. grafana and build a dashboard (i will be pushing some documentation around this in the near future)
  • The easiest way to get to the UI and see Locust running is to simply port-forward the UI port of the locust-master container/pod then you can access the UI on localhost

@AbdelrhmanHamouda
Copy link
Contributor Author

AbdelrhmanHamouda commented Nov 1, 2022

@DennisKrone I am planning to push the v1.0.0 release in the near future and I would like to have your insights to consider before pushing that version.

@cyberw As i just mentioned, I am planning to push the 1.0.0 in the near future and I would like to add a reference to the operator in the locust documentation. Would this contribution be welcomed?

I would like to add that the Operator is been actively and reliably utilised in AWS based k8s cluster/s for over 7 month by this point.

@cyberw
Copy link
Collaborator

cyberw commented Nov 1, 2022

Hi!

@DennisKrone is actively working on adding this to our own workflow, and from what I've heard so far he's happy with it (I'm sure he'll have some feedback too)

I would very much welcome adding this to the documentation!

@github-actions
Copy link

github-actions bot commented Jan 1, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Jan 1, 2023
@cyberw cyberw removed the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Jan 1, 2023
AbdelrhmanHamouda added a commit to AbdelrhmanHamouda/locust that referenced this issue Jan 16, 2023
locustio#2188 

- Update `Running a distributed load test on Kubernetes` docs section to include Locust Kubernetes Operator. 
- Small reformat of the section to clearly list all possibilities (HELM & Operator)  in a structured manner.
cyberw added a commit that referenced this issue Jan 16, 2023
docs (#2188):  Add Locust Kubernetes Operator
@cyberw
Copy link
Collaborator

cyberw commented Feb 28, 2023

Done!

@cyberw cyberw closed this as completed Feb 28, 2023
@treussart
Copy link

Hi for info, I had developed for a project something similar: https://github.com/treussart/locust-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants