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

feat: Provide hostname for zonal disk insert API #1849

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rishita-Golla
Copy link

CL contains changes to pass in hostname for zonal disk.insert API as a part of location hint field. These changes are enabled behind a feature flag.

What type of PR is this?

/kind feature

What this PR does / why we need it:
To improve performance when provisioning PDs, we can optimize their placement by using the hostname of the VM. In case of delayed binding, since the VM is already known, we can use this information to pass hostname as a parameter to the driver's create volume requests. For PD creation, the hostname can be included in location hint field in the disks.insert call. This ensure the PD is created as close as possible to the VM, minimizing latency and cross-cell attachments.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
Changes for regional disks will be part of future CLs.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Oct 23, 2024
Copy link

linux-foundation-easycla bot commented Oct 23, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Rishita-Golla / name: Rishita Golla (ba2bb17)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Oct 23, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @Rishita-Golla!

It looks like this is your first PR to kubernetes-sigs/gcp-compute-persistent-disk-csi-driver 🎉. 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-sigs/gcp-compute-persistent-disk-csi-driver 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
Copy link
Contributor

Hi @Rishita-Golla. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 23, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Rishita-Golla
Once this PR has been reviewed and has the lgtm label, please assign songjiaxun for approval. For more information see the Kubernetes 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

@Rishita-Golla Rishita-Golla marked this pull request as draft October 23, 2024 00:07
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 23, 2024
@mattcary
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 Oct 23, 2024
@@ -1596,12 +1596,12 @@ func (cloud *FakeCloudProviderInsertDiskErr) AddDiskForErr(volKey *meta.Key, err
cloud.insertDiskErrors[volKey.String()] = err
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to add some sort of test that we can actually fetch the PVC correctly. Otherwise we're relying only on the k8s integration tests, and it will be harder to catch a regression.

I'll have to think on how to do that, though. The local api server testing setup I usually use will be hard to use in this context. Maybe you can poke around k/k to see if there's a lightweight mock?

Copy link
Author

Choose a reason for hiding this comment

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

True! I wanted to discuss about this, hence marked the PR as draft.
We could set up a mock client, but I'm not sure how useful/ how often it will be used in this repo. Will check in k/k if I find something.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think something where we can confirm the expected PVC query happens, and the returned name is correctly plumbed into the gcp insert request, would be enough.

Copy link
Author

@Rishita-Golla Rishita-Golla Oct 23, 2024

Choose a reason for hiding this comment

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

I'm thinking using this fake package will be a good idea. We can create a client with PVC resource and check the returned hostname. Let me know your thoughts on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, I think that should do the trick.

Be sure to have tests using this, and also when it's nil (ie the hostname flag is not set)

Copy link
Author

@Rishita-Golla Rishita-Golla Nov 7, 2024

Choose a reason for hiding this comment

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

Changes are not tested in staging yet due to a blocking issue. Updated the CL to include tests with fake-client and its imports.

@k8s-ci-robot
Copy link
Contributor

@Rishita-Golla: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gcp-compute-persistent-disk-csi-driver-verify d4db94a link true /test pull-gcp-compute-persistent-disk-csi-driver-verify
pull-gcp-compute-persistent-disk-csi-driver-e2e d4db94a link true /test pull-gcp-compute-persistent-disk-csi-driver-e2e

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

CL contains changes to pass in hostname for zonal disk.insert API as a
part of location hint field. Code changes for regional disk API will be
part of future CLs.
@k8s-ci-robot k8s-ci-robot 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 Nov 7, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 7, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. 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