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: decouple vmss with 0 instance from lb when deleting the service #2489
Conversation
✅ Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.
|
pkg/provider/azure_vmss_cache.go
Outdated
lastUpdate: time.Now().UTC(), | ||
}) | ||
} | ||
localCache.Store(*scaleSet.Name, &vmssEntry{ |
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.
Cache all vmss instead of only uniform ones. I don't think this will break the logic of vmss flex but @zmyzheng can correct me.
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.
This will break the logic.
pkg/provider/azure_vmssflex.go
Outdated
@@ -926,17 +926,7 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo | |||
} | |||
} | |||
|
|||
// 1. Ensure the backendPoolID is deleted from the VMSS. |
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.
Since we ensure all vmss are decoupled from the lb in azure_vmss.go, we don't need it here, right?
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 we should still need it. Per AKS request, I will add another vmType == vmssflex for pure vmssflex cluster. In this case, we skip the node type check and only initialize FlexScaleSet ( similar to the pure standalone VM cluster).
pkg/provider/azure_vmss_cache.go
Outdated
@@ -92,13 +92,11 @@ func (ss *ScaleSet) newVMSSCache() (*azcache.TimedCache, error) { | |||
klog.Warning("failed to get the name of VMSS") | |||
continue | |||
} | |||
if scaleSet.OrchestrationMode == "" || scaleSet.OrchestrationMode == compute.OrchestrationModeUniform { |
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.
this has changed the original vmss flex behavior cc @zmyzheng
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.
We should not save VMSS Flex into the vmssCache.
vmssCache is only used for vmss uniform (although the name is a little missleading)
The VMSS Flex cache is inside ss.flexScaleSet.vmssFlexCache
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.
The main reason we need two different caches is because the vm list API is different between Uniform and Flex
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.
Thanks for the review. I roll back the change and use flex cache to get all vmss. Can you help review again?
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.
lgtm
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.
/lgtm
/hold |
klog.V(3).Infof("ensureBackendPoolDeletedFromVMSS: found vmss %s being deleted, skipping", to.String(vmss.Name)) | ||
return true | ||
} | ||
if vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations == nil { |
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.
When using VMSS Flex, it is possible the VMSS Flex does not have vm profile. We can skip the VMSS FLex which does not have vm profile
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.
Done
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, feiskyer, nilo19, zmyzheng 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 |
/lgtm |
@zmyzheng: changing LGTM is restricted to collaborators In response to this:
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. |
/hold cancel |
Need an LGTM. |
/lgtm |
/cherrypick release-1.25 |
@nilo19: #2489 failed to apply on top of branch "release-1.25":
In response to this:
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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
We parse the id of ipConfigs in the lb backend pool to determine what vmss are needed to be decoupled from the lb. But for those with 0 instance, they cannot be decoupled since there is no corresponding ipConfigs in the lb. This PR checks all cached vmss, if it is bound with the lb, we decouple it.
Which issue(s) this PR fixes:
Fixes #2443
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: