-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Dual-stack: fix the bug that Service clusterIP does not respect specified ipFamily #89612
Conversation
@@ -574,7 +574,9 @@ func (r *REST) getAllocatorBySpec(service *api.Service) ipallocator.Interface { | |||
} | |||
|
|||
secondaryAllocatorCIDR := r.secondaryServiceIPs.CIDR() | |||
if *(service.Spec.IPFamily) == api.IPv6Protocol && netutil.IsIPv6CIDR(&secondaryAllocatorCIDR) { | |||
secondaryAllocatorIsIPv6 := netutil.IsIPv6CIDR(&secondaryAllocatorCIDR) | |||
if *(service.Spec.IPFamily) == api.IPv6Protocol && secondaryAllocatorIsIPv6 || |
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.
looking at the method
func (r *REST) getAllocatorByClusterIP(service *api.Service) ipallocator.Interface {
I think that it has the same problem and we should fix it there too.
Just one comment to fix https://github.com/kubernetes/kubernetes/pull/89612/files#diff-a17c85ca4491ca68b2c928ed6221828eR556 too. |
/sig network |
cc @smarterclayton this also needs a test demonstrating the bug and that this fixes the issue |
Signed-off-by: SataQiu <1527062125@qq.com>
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. Also verified that is works on cluster.
@liggitt I think that Clayton's PR is totally related but it's leaning towards a more in deep revision of the whole dual-stack API and is not likely to be merged soon, however, this PR is just fixing current dual-stack implementation that assumes that the secondary ip allocator is always ipv6.
Absolutely, I think that this is something that we should stress for going to beta with dual-stack, IMHO at least we should have:
@aramase do you think that we can add another job like current azure-dual stack end to end with IPv6 as primary address? https://k8s-testgrid.appspot.com/sig-network-dualstack-azure-e2e#dualstack-azure-e2e-master meanwhile it seems we have to rely on manual testing, per @uablrek comment
and unit testing :( Anyway, this is LGTM to me but I defer to @thockin and @smarterclayton the last decision. |
hmm I think that I understand your point @liggitt 😅
|
@aojea How did you get that? I have not seen anything like that. |
|
Ah, I thught it was with this PR. Thanks. |
Do you know if this merge will be provided in a version 1.19 or 1.18.x ?? because currently, I have a dualstack ipv6/ipv4 cluster but I cannot use ipv4 o :-) |
in general, I would not expect backports for alpha-level features |
/priority important-soon |
that will be awesome, we can add it to the new KEP review ... |
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!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SataQiu, thockin 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 |
Nice, it only remains to wait for the release :) |
Signed-off-by: SataQiu 1527062125@qq.com
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fix the bug that Service clusterIP does not respect specified ipFamily
Which issue(s) this PR fixes:
Fixes #89610
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: