Skip to content

Conversation

GunaKKIBM
Copy link

What type of PR is this?

Add one of the following kinds:
/kind feature

What this PR does / why we need it:

Adding support for benchmarking list request for pods and CR

Which issue(s) this PR fixes:

kubernetes/kubernetes#130169

Special notes for your reviewer:

Couple of things that aren't covered in this PR

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 4, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @GunaKKIBM!

It looks like this is your first PR to kubernetes/perf-tests 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/perf-tests has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 4, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @GunaKKIBM. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot requested a review from mborsz July 4, 2025 06:35
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GunaKKIBM
Once this PR has been reviewed and has the lgtm label, please assign wojtek-t for approval. For more information see the Code Review Process.

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

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

@k8s-ci-robot k8s-ci-robot requested a review from wojtek-t July 4, 2025 06:35
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 4, 2025
@GunaKKIBM
Copy link
Author

Respective PR in test-infra: kubernetes/test-infra#35086

@GunaKKIBM
Copy link
Author

@mborsz @serathius @wojtek-t Please review this PR. If the changes look good for Pod resource type, I can do the same for ClusterRole as well. Thanks!

@serathius
Copy link
Contributor

This looks good, one thing to address is that we would like to have control over object size, so we can test cases where pod objects are larger than simple nginx pod. We could add it in another iteration.

name: {{.Name}}
labels:
app: {{$group}}
spec:
Copy link
Contributor

Choose a reason for hiding this comment

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

The goal is to measure the cost of Listing objects from apiserver. Pods are a different from configmaps as they cannot be passively created without side effects. Immediately after pod creation K8s controllers will start processing them for container to run, scheduler will assign node, Kubelet will pull it and start updating status etc. We would like to avoid that.

Could you propose some way to avoid those pods being processed? For example adding a node selector that prevents scheduling or find other ways to disable scheduler?

Copy link
Author

Choose a reason for hiding this comment

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

After checking how and where perfdash is deployed which led me to this link -https://github.com/kubernetes/k8s.io/blob/main/running-in-community-clusters.md

Adding nodeaffinity/antiaffinity didn't seem like the right option, hence chose to put a schedulerName which is simpler.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good

@GunaKKIBM
Copy link
Author

This looks good, one thing to address is that we would like to have control over object size, so we can test cases where pod objects are larger than simple nginx pod. We could add it in another iteration.

Just wanted get some clarification here, here object size maps to requests for cpu and memory for the pod right? for which I can add arguments in the job to make in configurable.

@serathius
Copy link
Contributor

object size maps to requests for cpu and memory for the pod right?

No, the size of manifest in bytes. See the configmap. We just load random bytes.

@GunaKKIBM
Copy link
Author

object size maps to requests for cpu and memory for the pod right?

No, the size of manifest in bytes. See the configmap. We just load random bytes.

The simplest way I could think of increasing the pod manifest size was to set an env variable, whose value is random data whose size is configurable. I have updated the PR accordingly, please take a look.

@serathius
Copy link
Contributor

Will take a look tomorrow.

@serathius
Copy link
Contributor

serathius commented Aug 20, 2025

Running the test locally fails for me with:

F0820 12:10:01.400825  366852 clusterloader.go:388] Test compilation failed: [config reading error: parsing error: template: :96: undefined variable "$podsNumber"]
exit status 1

Please follow https://github.com/kubernetes/perf-tests/tree/master/clusterloader2/testing/list to test it locally yourself.

@GunaKKIBM
Copy link
Author

podsNumber

It was an issue with brackets where podsNumber is defined, fixed now. Thank you!

@serathius
Copy link
Contributor

It was an issue with brackets where podsNumber is defined, fixed now. Thank you!

Great find! I totally missed that

@serathius
Copy link
Contributor

ok-to-test

@kishen-v
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 21, 2025
namePrefix: "list-configmaps-"
replicas: 0

- name: Create pods
Copy link
Contributor

Choose a reason for hiding this comment

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

Think you should delete configmaps and wait couple of minutes so that they are not counted in memory used when collecting metrics for pods.

Copy link
Author

@GunaKKIBM GunaKKIBM Aug 21, 2025

Choose a reason for hiding this comment

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

I might need a little help with some reference or example within in this repo. Does the action - "delete" help? I tried looking into any existing examples, but not quite sure.

Copy link
Author

Choose a reason for hiding this comment

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

@mborsz , could you please help me here?

Copy link
Author

Choose a reason for hiding this comment

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

@mborsz @wojtek-t I am still looking for some help here!

- module: *startMeasurements
- name: Wait 5 minutes
measurements: *waitMeasurements
- module: *gatherMeasurements
Copy link
Contributor

Choose a reason for hiding this comment

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

Doing measurements this way will override file with configmap measurements. We need to put them in separate files.

cc @mborsz for ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants