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

Fix standalone VM EnsureBackendPoolDeleted #4217

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Jul 4, 2023

What type of PR is this?

/kind testing
/kind bug

What this PR does / why we need it:

  • Fix ensureBackendPoolDeleted for standalone VM
  • Trigger Service reconcile for exclude-from-external-load-balancers e2e test
  • Refactor e2e
  • Add logs for exclude-from-external-load-balancers

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix ensureBackendPoolDeleted for standalone VM

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


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 4, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 4, 2023
@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch 2 times, most recently from f3535a2 to b00000e Compare July 4, 2023 08:35
@lzhecheng
Copy link
Contributor Author

/retest

@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch from b00000e to 2582c27 Compare July 4, 2023 11:52
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 4, 2023
@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch from 2582c27 to 452b9c3 Compare July 4, 2023 11:53
@@ -1229,9 +1229,11 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) {
switch {
case !isNodeManagedByCloudProvider:
az.excludeLoadBalancerNodes.Insert(newNode.ObjectMeta.Name)
klog.V(4).Infof("excluding Node %q from LoadBalancer because it is not managed by cloud provider", newNode.ObjectMeta.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will add a lot of logs for large clusters. Can we change it to 6?

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 chose 4 because I think the log level should be same with the below logic:

		for _, address := range getNodePrivateIPAddresses(newNode) {
			if az.nodePrivateIPs[newNode.Name] == nil {
				az.nodePrivateIPs[newNode.Name] = sets.New[string]()
			}

			klog.V(4).Infof("adding IP address %s of the node %s", address, newNode.Name)
			az.nodePrivateIPs[newNode.Name].Insert(address)
		}

Shall we make all of them 6?

@lzhecheng lzhecheng changed the title [e2e] Enhance exclude-from-external-load-balancers related e2e and log Fix standalone VM EnsureBackendPoolDeleted Jul 5, 2023
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jul 5, 2023
@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch from 452b9c3 to ac3c8a9 Compare July 5, 2023 03:06
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

@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 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 5, 2023
@lzhecheng
Copy link
Contributor Author

/retest

@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch from ac3c8a9 to 12f271b Compare July 5, 2023 11:34
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 5, 2023
} else {
lbBackendPoolIPConfigsCount := 0
if utils.IsAutoscalingAKSCluster() {
for _, ipconfig := range *(*lb.BackendAddressPools)[getLBBackendPoolIndex(lb)].BackendIPConfigurations {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can check loadBalancerBackendAddresses as well for nic lb

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 think it is a good idea but after I tried, it seems not possible.
I found that the LoadBalancerBackendAddress struct in:
https://github.com/kubernetes-sigs/cloud-provider-azure/blob/0e6c0a55c732dad2e4b8b946b234c118259769f4/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go
is:

type LoadBalancerBackendAddress struct {
	// LoadBalancerBackendAddressPropertiesFormat - Properties of load balancer backend address pool.
	*LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"`
	// Name - Name of the backend address.
	Name *string `json:"name,omitempty"`
}

It should have ID but actually not. ID is need for autoscaling cluster to avoid taking systempool into consideration.

Copy link
Contributor

Choose a reason for hiding this comment

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

it's in properties.networkInterfaceIPConfiguration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. Updated

@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch from 12f271b to ac0a8a2 Compare July 6, 2023 12:30
* Fix ensureBackendPoolDeleted for standalone VM
* Trigger Service reconcile for exclude-from-external-load-balancers e2e
test
* Refactor e2e
* Add logs for exclude-from-external-load-balancers

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
@lzhecheng lzhecheng force-pushed the print-backendIPConfigIDs-exclude-from-external-load-balancers branch from ac0a8a2 to 3d1b7ca Compare July 6, 2023 16:35
@nilo19
Copy link
Contributor

nilo19 commented Jul 7, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2023
@k8s-ci-robot k8s-ci-robot merged commit c48a4a7 into kubernetes-sigs:master Jul 7, 2023
16 checks passed
@lzhecheng lzhecheng deleted the print-backendIPConfigIDs-exclude-from-external-load-balancers branch July 7, 2023 10:13
@lzhecheng
Copy link
Contributor Author

/cherrypick release-1.27

@k8s-infra-cherrypick-robot

@lzhecheng: #4217 failed to apply on top of branch "release-1.27":

Applying: Fix standalone VM EnsureBackendPoolDeleted * Fix ensureBackendPoolDeleted for standalone VM * Trigger Service reconcile for exclude-from-external-load-balancers e2e test * Refactor e2e * Add logs for exclude-from-external-load-balancers
Using index info to reconstruct a base tree...
M	pkg/provider/azure.go
M	pkg/provider/azure_loadbalancer.go
M	pkg/provider/azure_loadbalancer_backendpool.go
M	pkg/provider/azure_standard.go
M	tests/e2e/network/ensureloadbalancer.go
M	tests/e2e/utils/node_utils.go
Falling back to patching base and 3-way merge...
Auto-merging tests/e2e/utils/node_utils.go
CONFLICT (content): Merge conflict in tests/e2e/utils/node_utils.go
Auto-merging tests/e2e/network/ensureloadbalancer.go
CONFLICT (content): Merge conflict in tests/e2e/network/ensureloadbalancer.go
Auto-merging pkg/provider/azure_standard.go
Auto-merging pkg/provider/azure_loadbalancer_backendpool.go
Auto-merging pkg/provider/azure_loadbalancer.go
CONFLICT (content): Merge conflict in pkg/provider/azure_loadbalancer.go
Auto-merging pkg/provider/azure.go
CONFLICT (content): Merge conflict in pkg/provider/azure.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 Fix standalone VM EnsureBackendPoolDeleted * Fix ensureBackendPoolDeleted for standalone VM * Trigger Service reconcile for exclude-from-external-load-balancers e2e test * Refactor e2e * Add logs for exclude-from-external-load-balancers
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.27

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/testing 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants