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
Use GA topology labels for EBS #99130
Conversation
/triage accepted I guess this PR is a lot smaller than the GCE counterpart because gce nodes can be moved to different zones and has more code to account for that.. |
/test pull-kubernetes-e2e-kops-aws |
No storage related failures on kops-aws test. /retest |
probably needs to be updated too. |
There may be some work needed in the translation library to recognize region labels (can be looked at separately). Similar to https://github.com/kubernetes/kubernetes/pull/97823/files#diff-91f0ca8be9396a2cd3e57cf95a919896eb6821a64b509dc9f96e6a1d730ab1c3R380 |
fec7a55
to
339b8b4
Compare
@@ -253,3 +259,90 @@ func KubernetesVolumeIDToEBSVolumeID(kubernetesID string) (string, error) { | |||
|
|||
return awsID, nil | |||
} | |||
|
|||
// This code is copied over from gce_pd as is. However, we're passing our own getRegionFromZones implementation. | |||
// It might be worth moving this to a common place and pass that function as a parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noted this here from your conversation, but I can definitely move this to a common place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah if you can move this to a shared library that would be great! cc @Jiawei0227
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think it would be good if we can combine this into a common place, something like
type regionParserFn([]string) (string, error)
func regionTopologyHandler(pv *v1.PersistentVolume, regionParser regionParserFn) error {...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do! Is in_tree_volume.go
a good place for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Thanks!
@@ -270,7 +271,7 @@ type regionTopologyHandler func(pv *v1.PersistentVolume) error | |||
// 1. Replace all CSI topology to Kubernetes Zone topology label | |||
// 2. Process and generate region topology if a regionTopologyHandler is passed | |||
// 3. Add Kubernetes Topology labels(zone) if they do not exist | |||
func translateTopologyFromCSIToInTree(pv *v1.PersistentVolume, csiTopologyKey string, regionTopologyHandler regionTopologyHandler) error { | |||
func translateTopologyFromCSIToInTree(pv *v1.PersistentVolume, csiTopologyKey string, regionTopologyHandler regionTopologyHandlerFn, regionParser regionParserFn) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to make regionParser part of regionTopologyHandler, but couldn't find a simple way. Open to suggestions :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about remove the type regionTopologyHandlerFn, I think the regionTopologyHandler()
should be generic enough to be shared?
And then the code will be like:
func translateTopologyFromCSIToInTree(pv *v1.PersistentVolume, csiTopologyKey string, regionParser regionParserFn) error {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually did that change but then reverted it back because of this line specifically. If we're OK with using the regionParser
for the nil check, should be a trivial change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be okay
0ee8598
to
85203fa
Compare
85203fa
to
e500271
Compare
/retest |
/lgtm |
return "", fmt.Errorf("no zones specified") | ||
} | ||
|
||
// AWS zones can be in four forms: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about copying/using
// Derives the region from a valid az name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u r right it will break on wavelength zone .
/approve In the release notes, can you reference the exact label key? |
@msau42 Done. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ayberk, cheftako, msau42, wongma7 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 |
@ayberk: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
/retest |
A short question on this, what happens to existing STS and PVs? How is the migration path here? |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Similar to #98700, this PR replaces the deprecated topology labels in favor of the new GA ones for EBS plugin.
Which issue(s) this PR fixes:
Fixes #97785
Does this PR introduce a user-facing change?
/sig storage
/cc @msau42 @wongma7