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

Use GA topology labels for EBS #99130

Merged
merged 2 commits into from Feb 24, 2021
Merged

Conversation

ayberk
Copy link
Contributor

@ayberk ayberk commented Feb 16, 2021

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?

[ACTION REQUIRED] Newly provisioned PVs by EBS plugin will no longer use the deprecated "failure-domain.beta.kubernetes.io/zone" and "failure-domain.beta.kubernetes.io/region" labels. It will use "topology.kubernetes.io/zone" and "topology.kubernetes.io/region" labels instead.

/sig storage
/cc @msau42 @wongma7

@k8s-ci-robot k8s-ci-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/storage Categorizes an issue or PR as relevant to SIG Storage. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 16, 2021
@k8s-ci-robot k8s-ci-robot added area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Feb 16, 2021
@wongma7
Copy link
Contributor

wongma7 commented Feb 16, 2021

/triage accepted
/lgtm

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..

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 16, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 16, 2021
@wongma7
Copy link
Contributor

wongma7 commented Feb 16, 2021

/test pull-kubernetes-e2e-kops-aws

@ayberk
Copy link
Contributor Author

ayberk commented Feb 16, 2021

No storage related failures on kops-aws test.

/retest

@ayberk ayberk changed the title Use GA topoogy labels for EBS Use GA topology labels for EBS Feb 16, 2021
@msau42
Copy link
Member

msau42 commented Feb 17, 2021

@msau42
Copy link
Member

msau42 commented Feb 17, 2021

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

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 18, 2021
@@ -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.
Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor

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 {...}

Copy link
Contributor Author

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?

Copy link
Contributor

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 {
Copy link
Contributor Author

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 :)

Copy link
Contributor

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 {

Copy link
Contributor Author

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.

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 it should be okay

@ayberk ayberk force-pushed the ebs_ga_labels branch 2 times, most recently from 0ee8598 to 85203fa Compare February 19, 2021 22:59
@ayberk
Copy link
Contributor Author

ayberk commented Feb 20, 2021

/retest

@Jiawei0227
Copy link
Contributor

/lgtm

If there is any CI in AWS or EKS please also sync with @wongma7 to update them.

@wongma7 for approval.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2021
@wongma7
Copy link
Contributor

wongma7 commented Feb 22, 2021

/lgtm
/approve

return "", fmt.Errorf("no zones specified")
}

// AWS zones can be in four forms:
Copy link
Contributor

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.
? seems simpler and less likely to break

Copy link
Contributor

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 .

@msau42
Copy link
Member

msau42 commented Feb 22, 2021

/approve

In the release notes, can you reference the exact label key?

@ayberk
Copy link
Contributor Author

ayberk commented Feb 22, 2021

@msau42 Done.

@Jiawei0227
Copy link
Contributor

/assign @cheftako
Hey Walter, can you help to approve this? This is similar to what we have done in #98700

@cheftako
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2021
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Feb 24, 2021

@ayberk: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kops-aws fec7a559ab95c319ecbe98abfd7f2eebcd577224 link /test pull-kubernetes-e2e-kops-aws

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.

@Jiawei0227
Copy link
Contributor

/retest

@jastBytes
Copy link

A short question on this, what happens to existing STS and PVs? How is the migration path here?

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. area/cloudprovider area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS EBS in-tree plugin: migrate to stable zone/region labels
7 participants