Skip to content

Add Scale Test - #284

Merged
kubernetes-prow[bot] merged 20 commits into
kubernetes-sigs:mainfrom
vitorfloriano:infra/add-scalability-test
Aug 14, 2026
Merged

Add Scale Test#284
kubernetes-prow[bot] merged 20 commits into
kubernetes-sigs:mainfrom
vitorfloriano:infra/add-scalability-test

Conversation

@vitorfloriano

@vitorfloriano vitorfloriano commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a scale test harness for Node Readiness Controller. The test harness runs on a single rule on a 1000 nodes by default, and offers different tuning parameters for QPS, Burst, concurrent workers, among others.

Benchmarking plan:

In this first iteration, we test how NRC performs when reconciling a single NodeReadinessRule in continuous mode to 1000 nodes (default node count).
We switch conditions to true and false to observe the controller adding and removing taints from nodes.

Next iterations can include more test cases, like:

  • Different node counts
  • Different rule counts
  • Bootstrap-only mode
  • Different runtimes (kind, podman)

We also selected the metrics we deemed most relevant for the scalability report.

Here's a list of all metrics exposed/scraped during the test run:

available metrics at the controller endpoint

  • Custom Controller Metrics (Node Readiness Specific)

    • node_readiness_condition_failures_total: Total number of failed condition evaluations by rule and condition name.
    • node_readiness_evaluation_duration_seconds_bucket / _count / _sum: Histogram of the duration (in seconds) taken
    to evaluate rules.
    • node_readiness_reconciliation_latency_seconds_bucket / _count / _sum: Histogram of total node readiness
    reconciliation latency.
    • node_readiness_rule_last_reconciliation_timestamp_seconds: Timestamp (Unix epoch) when a rule was last reconciled.
    • node_readiness_rules_total: Total number of active node readiness rules.
    • node_readiness_taint_operations_total: Total number of taint operations (add/remove) executed.

  • controller-runtime Core Metrics

    • controller_runtime_active_workers: Number of active reconciler workers.
    • controller_runtime_max_concurrent_reconciles: Configured maximum concurrent reconciles for a controller.
    • controller_runtime_reconcile_total: Total number of reconciliations.
    • controller_runtime_reconcile_errors_total: Total number of reconciliation errors.
    • controller_runtime_reconcile_panics_total: Total number of reconciler panics.
    • controller_runtime_reconcile_time_seconds_bucket / _count / _sum: Histogram of time spent on reconciliations.
    • controller_runtime_conversion_webhook_panics_total / controller_runtime_webhook_panics_total: Total panics inside
    conversion or admission webhooks.
    • controller_runtime_terminal_reconcile_errors_total: Total terminal reconciliation errors.

  • client-go Workqueue Metrics

    • workqueue_adds_total: Total number of tasks added to the workqueue.
    • workqueue_depth: Current queue depth.
    • workqueue_longest_running_processor_seconds: Processing time of the longest running task.
    • workqueue_queue_duration_seconds_bucket / _count / _sum: Histogram of how long items sit in the workqueue before
    processing.
    • workqueue_work_duration_seconds_bucket / _count / _sum: Histogram of how long processing an item takes.
    • workqueue_retries_total: Total number of task retries.
    • workqueue_unfinished_work_seconds: Seconds spent on currently running unfinished tasks.

  • client-go REST Client Metrics

    • rest_client_requests_total: Total HTTP requests made by the Kubernetes API client.

  • OS Process Metrics (Host Resources)

    • process_cpu_seconds_total: Total CPU user and system time spent in seconds.
    • process_resident_memory_bytes: Resident memory size (RSS) in bytes.
    • process_virtual_memory_bytes / _max_bytes: Virtual memory size.
    • process_open_fds / _max_fds: Number of open file descriptors.
    • process_network_receive_bytes_total / _transmit_bytes_total: Network traffic bytes.
    • process_start_time_seconds: Start time of the process.

  • Go Runtime Internal Metrics

    • go_goroutines: Number of active goroutines.
    • go_threads: Number of OS threads.
    • go_info: Information about the Go runtime version.
    • go_memstats_alloc_bytes / go_memstats_sys_bytes: Go heap memory stats.
    • go_gc_duration_seconds / _count / _sum: Garbage collector cycles durations.
    • go_sched_latencies_seconds_bucket: Go scheduler queue latency histogram.

  • Prometheus Scraper Metrics

    • scrape_duration_seconds: Time taken to run the scraper query.
    • scrape_samples_scraped: Number of metric samples retrieved.
    • up: Health status of the scraped controller instance (1 = healthy, 0 = down).

Key design choices:

Dependencies

The test only depends on kwokctl and kubectl being available at PATH. We ensure kwokctl is available and download the binary to hack/tools/bin right at the start of the test, if missing.

The dependency on Prometheus and core components of the control-plane is completely managed by kwokctl.

Testing

I've run the scale test multiple times, with different configurations.

Release Notes

Since this is mostly infra, a release note may not be necessary.

Note

LLM Usage: I used Gemini 3.5 Flash Medium with Antigravity CLI for planning and writing some parts with tricky logic. The code was reviewed by me and manually test multiple times.

Supersedes #185

@kubernetes-prow

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 27, 2026
@netlify

netlify Bot commented Jun 27, 2026

Copy link
Copy Markdown

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit 8136c5a
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6a7e93f373d2b40008a8f1a4

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 27, 2026
@vitorfloriano

Copy link
Copy Markdown
Contributor Author

/cc @Karthik-K-N
/cc @ajaysundark
/cc @Priyankasaggu11929

@vitorfloriano vitorfloriano left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After much research, this is the initial work. I got a LGTM on the approach from Kwok's maintainer, so I believe I'm headed in the right direction. PTAL.

Comment thread hack/scale-test-setup.sh Outdated
Comment thread hack/scale-test-setup.sh Outdated
Comment thread hack/scale-test-setup.sh Outdated
@vitorfloriano
vitorfloriano force-pushed the infra/add-scalability-test branch 2 times, most recently from 4c64f75 to f3886a3 Compare July 8, 2026 23:36
@vitorfloriano
vitorfloriano force-pushed the infra/add-scalability-test branch from f3886a3 to 53fa656 Compare July 9, 2026 18:48
@kubernetes-prow kubernetes-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 9, 2026
@vitorfloriano vitorfloriano changed the title WIP infra: Add Scale Test Add Scale Test Jul 9, 2026
@vitorfloriano
vitorfloriano marked this pull request as ready for review July 9, 2026 19:42
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2026
@vitorfloriano
vitorfloriano marked this pull request as draft July 14, 2026 15:11
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 14, 2026
@vitorfloriano vitorfloriano changed the title Add Scale Test WIP Add Scale Test Jul 14, 2026
@vitorfloriano

Copy link
Copy Markdown
Contributor Author

@ajaysundark @Priyankasaggu11929 @Karthik-K-N

Following up to our conversation, I'm going to refine the markdown report, perhaps vet some of the metrics there to make it cleaner and easier to draw insights from.

@kubernetes-prow kubernetes-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 16, 2026
@vitorfloriano

Copy link
Copy Markdown
Contributor Author

@Priyankasaggu11929 I addressed your comments from your first round and refactored a bunch of stuff. I also reshaped the template for the report and refactored the test config to make it more concise.

I'll leave the Prom queries out of it for now to let others review.

PTAL.

Comment thread test/scale/promqueries.go
| :--- | :--- |
| **Taint Operations (Added)** | {{index .Metrics "taint_operations_add"}} |
| **Taint Operations (Removed)** | {{index .Metrics "taint_operations_remove"}} |
| **Condition Check Failures** | {{index .Metrics "condition_failures_total"}} |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not actionable now. but I proposed to deprecate this metric in the new metric surface. The reason is that this just counts "condition-not-satisfied" at every iteration, which really are not 'failures'. At scale, this shouldn't bring out bad impression of state of things

@ajaysundark

Copy link
Copy Markdown
Contributor

/lgtm
/approve

Thanks @vitorfloriano! We want to use this for release pipeline to be able to continuously validate for scale for all the release versions. We should plan to see how we can integrate this into CI with kwok "in-cluster" mode. We can follow up that work in #409

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 14, 2026
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ajaysundark, vitorfloriano

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 14, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 43aa78a into kubernetes-sigs:main Aug 14, 2026
12 checks passed
vitorfloriano added a commit to vitorfloriano/test-infra that referenced this pull request Aug 14, 2026
Adds the scale test merged in kubernetes-sigs/node-readiness-controller#284
using the following configuration:
KWOK_RUNTIME="binary"
NODE_COUNT=1000
ENFORCEMENT_MODE="continuous"
vitorfloriano added a commit to vitorfloriano/test-infra that referenced this pull request Aug 14, 2026
Adds the scale test merged in kubernetes-sigs/node-readiness-controller#284
as presubmit job using the following configuration:

KWOK_RUNTIME="binary"
NODE_COUNT=1000
ENFORCEMENT_MODE="continuous"
vitorfloriano added a commit to vitorfloriano/test-infra that referenced this pull request Aug 17, 2026
Adds the scale test merged in kubernetes-sigs/node-readiness-controller#284
as presubmit job using the following configuration:

KWOK_RUNTIME="binary"
NODE_COUNT=1000
ENFORCEMENT_MODE="continuous"
@ajaysundark

Copy link
Copy Markdown
Contributor

cc @rawadhossain

alien1403 pushed a commit to alien1403/test-infra that referenced this pull request Aug 19, 2026
Adds the scale test merged in kubernetes-sigs/node-readiness-controller#284
as presubmit job using the following configuration:

KWOK_RUNTIME="binary"
NODE_COUNT=1000
ENFORCEMENT_MODE="continuous"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants