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

Flannel IPv6: Incorrect sn6.IP.Cmp(config.IPv6SubnetMax) >= 0 comparison in allocateSubnet #1581

Closed
pranavadn opened this issue Jun 8, 2022 · 4 comments

Comments

@pranavadn
Copy link

Incorrect sn6.IP.Cmp(config.IPv6SubnetMax) >= 0 comparison in allocateSubnet causes failure in leasing out last subnet of a network.

Expected Behavior

The comparison should be sn6.IP.Cmp(config.IPv6SubnetMax) > 0.

Current Behavior

Fails to lease out the last subnet of a network. According to the definition it should be able to lease out the last subnet -

IPv6SubnetMax (string): The end of the IPv6 range at which the subnet allocation should end with. Defaults to the last subnet of Ipv6Network.

Possible Solution

Change comparison to sn6.IP.Cmp(config.IPv6SubnetMax) > 0 or to <=0 like you have in ipv4 -
sn.IP <= config.SubnetMax

Steps to Reproduce (for bugs)

  1. Have a 3 node setup.
  2. have /65 ipv6 network and subnet length of /67
  3. Third node fails to get a lease even though 3 subnets are available.
  4. It errors out with "Error registering network: failed to acquire lease: out of subnets"

Context

We need flannel to work with v6 for dual stack.

Your Environment

Flannel version:
v0.17.0

Backend used (e.g. vxlan or udp):
host-gw

Etcd version:
3.3.15

Kubernetes version (if used):
1.20

Operating System and version:
3.10.0-1160.62.1.el7.x86_64

  • Link to your project (optional):
@manuelbuil
Copy link
Collaborator

Thanks for reporting this. Note that Kubernetes 1.20 does not support ipv6. You should move to v1.23 where the feature became stable. Can you try there?

@pranavadn
Copy link
Author

@manuelbuil These issues are coding errors in Flannel. They are present in latest Flannel binary too. We are not using Kubernetes subnet manager either. Hence, it is the subnet leasing logic of Flannel that is being used on our setup. Could we please have these Flannel coding errors fixed?

@rbrtbnfgl
Copy link
Contributor

Is this solved?
If it is I'll close it.

@pranavadn
Copy link
Author

Yes. Please close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants