-
Notifications
You must be signed in to change notification settings - Fork 280
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] Fix reconcileFrontendIPConfigs() #3914
Conversation
✅ Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz |
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz |
pkg/provider/azure_loadbalancer.go
Outdated
handleFrontendIPConfig := func(isIPv6 bool) error { | ||
ownedFIPConfig, toDeleteConfigsSingleStack, changed, newConfigs, err := az.reconcileFrontendIPConfigsSingleStack(clusterName, service, lb, lbStatus, wantLb, isIPv6, lbFrontendIPConfigName[isIPv6], &subnet) | ||
ownedFIPConfig, toDeleteConfigsSingleStack, changed, newConfigs, err := az.reconcileFrontendIPConfigsSingleStack(clusterName, service, lb, lbStatus, wantLb, isIPv6, newConfigs[isIPv6], lbFrontendIPConfigName[isIPv6], &subnet) |
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 have had lb here in the parameters, why bother to build a list fip configs outside of the function?
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.
Because vXEnabled
-> handleFrontendIPConfig()
-> reconcileFrontendIPConfigsSingleStack()
.
If the Service is single stack, we need to handle the newConfigs
of the other IP family outside.
66a7f31
to
1c4679d
Compare
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz |
LGTM |
pkg/provider/azure_utils.go
Outdated
} | ||
if pip.PublicIPAddressPropertiesFormat != nil { | ||
if exist && pip.PublicIPAddressPropertiesFormat != 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.
Is it possible that the ipv6 public IP has not yet been created?
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.
It won't. One evidence is that the warning in isFIPIPv6()
shouldn't appear in CCM log: "Checking IP Family of frontend IP configuration %q but it is not clear. It's considered to be IPv4".
pkg/provider/azure_utils.go
Outdated
} | ||
|
||
klog.Errorf("Checking IP Family of frontend IP configuration %q but it is not clear. It's considered to be IPv4", pointer.StringDeref(fip.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.
It should be Warningf here.
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.
Updated.
/lgtm |
/hold |
/retest |
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz |
/test pull-cloud-provider-azure-e2e-ccm-ipv6-vmss-capz |
/test pull-cloud-provider-azure-e2e-ccm-vmss-capz |
/retest |
2 similar comments
/retest |
/retest |
expectedDirty bool | ||
expectedFIPs []network.FrontendIPConfiguration | ||
}{ | ||
{ |
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.
can you add a test case for reconciling existing configs owned by the service without touching the others?
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.
also add some negative cases please
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.
UT added.
pkg/provider/azure_utils.go
Outdated
// First check private | ||
// For an external LB, the FIP's private IP address is empty. The logic will | ||
// go through this part and check public IP address then. | ||
if fip.FrontendIPConfigurationPropertiesFormat != 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.
I checked all the refs of this function. If we can make sure the fip is always owned by the service, the pip check is not needed.
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 FIP also needs to be isPrimaryService==true
. If it is the secondary Service, I think the pip check is still needed.
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.
If the fip is owned by a single stack service, we can check the service instead of pip, no matter if it is primary or secondary.
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.
It makes sense for single stack svc. Updated.
8169b11
to
98b7615
Compare
Have the test finished? |
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz @feiskyer the tests are manually triggered like above. Those runs before were successful |
Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz |
Current logic handles lb.FrontendIPConfigurations according to Service's IP family, which is incorrect. For an IPv6 cluster, there're still some IPv4 FIPs due to Azure limitation, which will be removed. For an IPv4 cluster, all resources are of IPv4, which is not affected. Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
/test pull-cloud-provider-azure-e2e-ccm-ipv6-capz |
/retest |
/lgtm |
if err := az.fillSubnet(subnet, *subnetName); err != nil { | ||
return false, err | ||
if subnet == nil { | ||
return false, fmt.Errorf("isFrontendIPChanged: Unexpected nil subnet") |
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.
nit: can we include subnet name in the error msg?
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.
Let's do it in the next PR.
/unhold |
/retest |
What type of PR is this?
/kind bug
What this PR does / why we need it:
[IPv6] Fix reconcileFrontendIPConfigs(). Current logic handles lb.FrontendIPConfigurations according to Service's IP family, which is incorrect. For an IPv6 cluster, there're still some IPv4 FIPs due to Azure limitation, which will be removed. For an IPv4 cluster, all resources are of IPv4, which is not affected.
Which issue(s) this PR fixes:
Fixes #4038
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: