Skip to content

Add force attach to storage class #1254

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

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

mattcary
Copy link
Contributor

@mattcary mattcary commented Jun 7, 2023

/kind feature

What this PR does / why we need it:
This adds an alpha-level storage class parameter to always perform a force attach. This is only valid for RePD disks (although this is not validated --- using this parameter with zonal disks will cause attaches to fail).

This parameter is not guaranteed to have continued support or to be stable in any way. In addition, using this can cause data loss.

Add alpha-level force attach storage class parameter.

@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 7, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 7, 2023
@mattcary
Copy link
Contributor Author

mattcary commented Jun 7, 2023

/test all

@mattcary
Copy link
Contributor Author

mattcary commented Jun 7, 2023

/test all

1 similar comment
@mattcary
Copy link
Contributor Author

mattcary commented Jun 7, 2023

/test all

@mattcary mattcary force-pushed the forceattach branch 2 times, most recently from 789c0d7 to d6917fe Compare June 7, 2023 22:12
@mattcary mattcary marked this pull request as ready for review June 7, 2023 22:20
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 7, 2023
@msau42
Copy link
Contributor

msau42 commented Jun 7, 2023

What's the plan for detach? Should repd always use force attach regardless?

@mattcary
Copy link
Contributor Author

mattcary commented Jun 7, 2023

What's the plan for detach? Should repd always use force attach regardless?

We don't know. For the PoC of an availability controller we're building we will be doing force attach unconditionally, because as far as we can tell it takes too long to figure out if it's necessary or not (this is what cloud sql does for instance).

But we have to evaluate. This is why I have the scary alpha/unsafe name, I think there's a good chance well figure out a better solution after we work through real-world options. I expect that this parameter will be removed & replaced with a better one.

@msau42
Copy link
Contributor

msau42 commented Jun 7, 2023

I'm wondering for the purpose of POC you can just have a feature gate, instead of an opt-in storageclass parameter that ends up as an immutable field on the PV object

@mattcary
Copy link
Contributor Author

mattcary commented Jun 7, 2023

I'm wondering for the purpose of POC you can just have a feature gate, instead of an opt-in storageclass parameter that ends up as an immutable field on the PV object

Do you mean a command-line flag that would enable this for the driver per-cluster? We need to enable this only on certain volumes, we'll be testing it in clusters where we only want some workloads to use this as we don't want to risk data loss by force-attaching cavalierly.

}

op, err := cloud.service.Instances.AttachDisk(project, instanceZone, instanceName, attachedDiskV1).Context(ctx).Do()
op, err := cloud.service.Instances.AttachDisk(project, instanceZone, instanceName, attachedDiskV1).Context(ctx).ForceAttach(forceAttach).Do()
Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually if this goes to production we may want a metric + log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The api call is in the audit logs, I'm not sure we need much more?

@mattcary mattcary force-pushed the forceattach branch 2 times, most recently from f6494ff to 6e7feb7 Compare June 8, 2023 19:36
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2023
@mattcary
Copy link
Contributor Author

mattcary commented Jun 9, 2023

Hmm, the e2e test succeeded locally after fixing the request-vs-query param problem. I'll have to dig.

Change-Id: Id07dbe608613d905dffa96aa119d7deadb1dca5d
Copy link
Contributor

@pwschuurman pwschuurman left a comment

Choose a reason for hiding this comment

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

/lgtm

case ParameterAvailabilityClass:
paramAvailabilityClass, err := ConvertStringToAvailabilityClass(v)
if err != nil {
return p, fmt.Errorf("parameters contain invalid availability class parameter: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Hyphenate "availability-class" to make it more clear what parameter is invalid.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 12, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattcary, pwschuurman

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

The pull request process is described 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 merged commit fef6601 into kubernetes-sigs:master Jun 12, 2023
@mattcary mattcary deleted the forceattach branch June 13, 2023 17:17
@mattcary
Copy link
Contributor Author

/cherry-pick release-1.10

@k8s-infra-cherrypick-robot

@mattcary: new pull request created: #1257

In response to this:

/cherry-pick release-1.10

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/test-infra repository.

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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants