feat: add HTTP load testing scenario plugin#1144
feat: add HTTP load testing scenario plugin#1144AR21SM wants to merge 4 commits intokrkn-chaos:mainfrom
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||
Signed-off-by: AR21SM <mahajanashishar21sm@gmail.com>
6a233a9 to
6c0e694
Compare
Signed-off-by: AR21SM <mahajanashishar21sm@gmail.com>
|
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Signed-off-by: AR21SM <mahajanashishar21sm@gmail.com>
|
|
||
| def resolve_ingress_url(self, kubecli, ingress_name, namespace, target_path): | ||
| try: | ||
| networking_v1 = client.NetworkingV1Api(kubecli.api_client) |
There was a problem hiding this comment.
let's add this section to krkn-lib instead of in krkn where we have all of our more main kubernetes based functions
|
|
||
| def resolve_route_url(self, kubecli, route_name, namespace, target_path): | ||
| try: | ||
| custom_api = client.CustomObjectsApi(kubecli.api_client) |
There was a problem hiding this comment.
same as above comment about adding this to krkn-lib
|
@AR21SM if possible, are you able to add a functional test here that will create a service on the kind cluster that gets created, and then run an http test. The functional tests live here: https://github.com/krkn-chaos/krkn/tree/main/CI/tests and will need to add to the list of functional tests in the github workflow (https://krkn-chaos.dev/docs/developers-guide/add-tests-krkn/#adding-a-new-functional-test) https://krkn-chaos.dev/docs/developers-guide/add-tests-krkn/#adding-a-new-functional-test |
| request_body: "" | ||
| content_type: "" | ||
| headers: {} | ||
| image: "williamyeh/hey:latest" |
There was a problem hiding this comment.
@AR21SM can you please add documentaiton details of this new scenario into https://github.com/krkn-chaos/website/pulls. Please definitely be sure to give details of the hey utility you're using here.
Co-authored-by: Claude Sonnet 4.5 <claude-sonnet-4-5@anthropic.com>
User description
Type of change
Description
Implements HTTP load testing scenario plugin to simulate heavy HTTP load on Kubernetes Services, Ingress, or OpenShift Routes. Uses the
heyHTTP load generator (chosen over Gatling/Goku for its lightweight single-binary design, existing Docker image, and simpler CLI-based configuration suitable for K8s Jobs).Features:
Related Tickets & Documents
Documentation
Related Documentation PR (if applicable)
Checklist before requesting a review
REQUIRED:
Description of combination of tests performed and output of run
python -m unittest tests.test_http_load_scenario_plugin -v test_build_load_command_basic (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_build_load_command_with_body_and_headers (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_build_load_command_with_content_type_only (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_build_load_command_with_rps (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_get_scenario_types (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_ingress_url (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_ingress_url_with_tls (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_route_url (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_route_url_no_tls (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_target_url_direct (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_target_url_service (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_resolve_target_url_service_not_found (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_run_create_job_failure (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_run_missing_target (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_run_service_not_found (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_run_success_with_service (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_run_with_ingress_target (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok test_run_with_route_target (tests.test_http_load_scenario_plugin.TestHttpLoadScenarioPlugin) ... ok ---------------------------------------------------------------------- Ran 18 tests in 15.048s OKPR Type
Enhancement
Description
Implements HTTP load testing scenario plugin using
heyload generatorSupports multiple target types: Services, Ingress, Routes, direct URLs
Configurable concurrency, duration, RPS limit, and HTTP parameters
Automatic TLS detection for Ingress and OpenShift Routes
Comprehensive test coverage with 18 unit tests (80%+ coverage)
Diagram Walkthrough
File Walkthrough
http_load_scenario_plugin.py
HTTP load testing plugin implementationkrkn/scenario_plugins/http_load/http_load_scenario_plugin.py
direct URLs
heyload test commands with configurable parameters(concurrency, duration, RPS, headers, body)
testing
test_http_load_scenario_plugin.py
Unit tests for HTTP load scenario plugintests/test_http_load_scenario_plugin.py
direct URL)
job.j2
Kubernetes Job template for load testingkrkn/scenario_plugins/http_load/job.j2
heyimage and load test commandhttp_load.yaml
Example HTTP load testing scenario configurationscenarios/kube/http_load.yaml