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

[IPv6] Choose correct primary IP config #3715

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Apr 7, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Choose correct primary IP config in ensureBackendPoolDeletedFromNode(). Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.

Which issue(s) this PR fixes:

Fixes #
Related: #3707

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Choose correct primary IP config in ensureBackendPoolDeletedFromNode(). Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@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/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 7, 2023
@netlify
Copy link

netlify bot commented Apr 7, 2023

Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.

Name Link
🔨 Latest commit 99ef413
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cloud-provide-azure/deploys/643e886458bf2c0008595c30

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 7, 2023
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 7, 2023
@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch from 0fe4c3c to f121ba8 Compare April 7, 2023 07:14
@lzhecheng lzhecheng changed the title [WIP][IPv6] Choose correct primary IP config in ensureBackendPoolDeletedFromNode() [IPv6] Choose correct primary IP config in ensureBackendPoolDeletedFromNode() Apr 7, 2023
@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 Apr 7, 2023
@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch from f121ba8 to 3007954 Compare April 10, 2023 08:38
@lzhecheng lzhecheng changed the title [IPv6] Choose correct primary IP config in ensureBackendPoolDeletedFromNode() [IPv6] Choose correct primary IP config Apr 10, 2023
@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch 2 times, most recently from 442a72a to 589f009 Compare April 11, 2023 05:57
pkg/provider/azure_vmss.go Outdated Show resolved Hide resolved
@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch from 589f009 to 6d1c2b3 Compare April 14, 2023 02:45
@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 Apr 14, 2023
@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch 3 times, most recently from 0b77b12 to d8167f6 Compare April 14, 2023 06:13
@lzhecheng
Copy link
Contributor Author

/retest

isIPv6 := isBackendPoolIPv6(backendPoolID)

if !isIPv6 {
// There should be one and only once primary IP config.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: there can only be at most one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch from d8167f6 to 5a53ffb Compare April 18, 2023 06:43
}
}

return nil, fmt.Errorf("failed to find a IPconfiguration(IPv6=%v) for the scale set VM %q", IPv6, nodeName)
return nil, fmt.Errorf("failed to find a primary IP configuration (IPv6=%v) for the VMSS VM or VMSS %q", isIPv6, resource)
Copy link
Contributor

Choose a reason for hiding this comment

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

s/%v/%t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

if primaryIPConfig.LoadBalancerBackendAddressPools != nil {
loadBalancerBackendAddressPools = *primaryIPConfig.LoadBalancerBackendAddressPools
}
handleBackendPool := func(backendPoolID string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extract it to a standalone function and reuse it across all the references?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I updated 3 places but don't touch the one (ensureBackendPoolDeletedFromVmssUniform) which is different (with a vmssNamesMap). Also, I added a UT for this new function.

@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch from 5a53ffb to 8f10b38 Compare April 18, 2023 10:13
Regardless of IPv6 only or dualstack clusters, IPv4
IP config is always primary. So for IPv6 backend
address pool, IP config's IP version needs consideration.

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
@lzhecheng lzhecheng force-pushed the fix-ipv6-vmss-choose-backendpool branch from 8f10b38 to 99ef413 Compare April 18, 2023 12:09
@kubernetes-sigs kubernetes-sigs deleted a comment from coveralls Apr 18, 2023
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm

thanks for the fix!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, lzhecheng

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 243bfa8 into kubernetes-sigs:master Apr 20, 2023
19 checks passed
@lzhecheng lzhecheng deleted the fix-ipv6-vmss-choose-backendpool branch April 20, 2023 05:24
@lzhecheng
Copy link
Contributor Author

/cherrypick release-1.26

@lzhecheng
Copy link
Contributor Author

/cherrypick release-1.25

@lzhecheng
Copy link
Contributor Author

/cherrypick release-1.24

@lzhecheng
Copy link
Contributor Author

/cherrypick release-1.23

@k8s-infra-cherrypick-robot

@lzhecheng: #3715 failed to apply on top of branch "release-1.26":

Applying: Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
Using index info to reconstruct a base tree...
M	pkg/provider/azure_vmss.go
M	pkg/provider/azure_vmss_test.go
M	pkg/provider/azure_vmssflex.go
M	pkg/provider/azure_vmssflex_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/provider/azure_vmssflex_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmssflex_test.go
Auto-merging pkg/provider/azure_vmssflex.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmssflex.go
Auto-merging pkg/provider/azure_vmss_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss_test.go
Auto-merging pkg/provider/azure_vmss.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.26

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.

@k8s-infra-cherrypick-robot

@lzhecheng: #3715 failed to apply on top of branch "release-1.25":

Applying: Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
Using index info to reconstruct a base tree...
M	pkg/provider/azure_vmss.go
M	pkg/provider/azure_vmss_test.go
M	pkg/provider/azure_vmssflex.go
M	pkg/provider/azure_vmssflex_cache_test.go
M	pkg/provider/azure_vmssflex_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/provider/azure_vmssflex_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmssflex_test.go
Auto-merging pkg/provider/azure_vmssflex_cache_test.go
Auto-merging pkg/provider/azure_vmssflex.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmssflex.go
Auto-merging pkg/provider/azure_vmss_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss_test.go
Auto-merging pkg/provider/azure_vmss.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.25

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.

@k8s-infra-cherrypick-robot

@lzhecheng: #3715 failed to apply on top of branch "release-1.24":

Applying: Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
Using index info to reconstruct a base tree...
M	pkg/provider/azure_vmss.go
M	pkg/provider/azure_vmss_test.go
A	pkg/provider/azure_vmssflex.go
A	pkg/provider/azure_vmssflex_cache_test.go
A	pkg/provider/azure_vmssflex_test.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): pkg/provider/azure_vmssflex_test.go deleted in HEAD and modified in Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.. Version Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration. of pkg/provider/azure_vmssflex_test.go left in tree.
CONFLICT (modify/delete): pkg/provider/azure_vmssflex_cache_test.go deleted in HEAD and modified in Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.. Version Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration. of pkg/provider/azure_vmssflex_cache_test.go left in tree.
CONFLICT (modify/delete): pkg/provider/azure_vmssflex.go deleted in HEAD and modified in Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.. Version Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration. of pkg/provider/azure_vmssflex.go left in tree.
Auto-merging pkg/provider/azure_vmss_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss_test.go
Auto-merging pkg/provider/azure_vmss.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.24

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.

@k8s-infra-cherrypick-robot

@lzhecheng: #3715 failed to apply on top of branch "release-1.23":

Applying: Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
Using index info to reconstruct a base tree...
M	pkg/provider/azure_vmss.go
M	pkg/provider/azure_vmss_test.go
A	pkg/provider/azure_vmssflex.go
A	pkg/provider/azure_vmssflex_cache_test.go
A	pkg/provider/azure_vmssflex_test.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): pkg/provider/azure_vmssflex_test.go deleted in HEAD and modified in Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.. Version Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration. of pkg/provider/azure_vmssflex_test.go left in tree.
CONFLICT (modify/delete): pkg/provider/azure_vmssflex_cache_test.go deleted in HEAD and modified in Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.. Version Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration. of pkg/provider/azure_vmssflex_cache_test.go left in tree.
CONFLICT (modify/delete): pkg/provider/azure_vmssflex.go deleted in HEAD and modified in Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.. Version Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration. of pkg/provider/azure_vmssflex.go left in tree.
Auto-merging pkg/provider/azure_vmss_test.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss_test.go
Auto-merging pkg/provider/azure_vmss.go
CONFLICT (content): Merge conflict in pkg/provider/azure_vmss.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Choose correct primary IP config Regardless of IPv6 only or dualstack clusters, IPv4 IP config is always primary. So for IPv6 backend address pool, IP config's IP version needs consideration.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.23

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/bug Categorizes issue or PR as related to a bug. 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.

None yet

5 participants