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

Dual-stack support #1448

Merged
merged 2 commits into from
Jul 13, 2021
Merged

Conversation

manuelbuil
Copy link
Collaborator

Add new option for flannel daemon to support dual stack:

  • "publicIPv6": "IPv6 accessible by other nodes for
    inter-host communication"

Add new option into net-conf.json configuration, like following:
{
"EnableIPv4": true,
"EnableIPv6": true,
"Network": "172.16.0.0/16",
"IPv6Network": "fc00::/48",
"Backend": {
"Type": "vxlan"
}
}
EnableIPv4 default value is true for using kube subnet manager.
EnableIpv6 default value is false.

Flannel dual stack feature has limitation, only work with vxlan backend
and kube subnet manager now. To enable flannel dual stack feature, need
to do the following step:

  1. setting flanneld daemon with "--kube-subnet-mgr"
  2. settting "EnableIPv6" and "IPv6Network" in "net-conf.json" like the
    above configuration.
  3. setting network interface that flannel used ipv6 address and
    default ipv6 gateway in the host node.
  4. vxlan support ipv6 tunnel require kernel version >= 3.12
  5. We require the Alpine image to move to version 3.13. Otherwise we get Failed to ensure iptables rules: Error tearing down rules: running [/sbin/ip6tables -t nat -D POSTROUTING -s fc00::/48 ! -d ff00::/8 -j MASQUERADE --random-fully --wait]: exit status 2: ip6tables v1.8.4 (legacy): unknown option "--random-fully" ==> Upgrade Alpine version #1447

Signed-off-by: yaoice [email protected]

Description

Todos

  • Tests
  • Documentation
  • Release note

Release Note

Dual-stack support for flannel with vxlan backend

It also need flannel cni plugin to support dual stack ip allocation, so it
depends on: containernetworking/plugins#570

#248

@manuelbuil manuelbuil changed the title Dualstack cherry pick Dual-stack support May 28, 2021
@manuelbuil manuelbuil force-pushed the dualstack-cherryPick branch 2 times, most recently from 869d8d9 to fcd6ba2 Compare May 28, 2021 14:33
@manuelbuil manuelbuil force-pushed the dualstack-cherryPick branch from fcd6ba2 to 5dd8eef Compare June 14, 2021 12:29
Copy link
Contributor

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

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

One question + stylistic nits


return nil
}

func (dev *vxlanDevice) MACAddr() net.HardwareAddr {
return dev.link.HardwareAddr
}

type neighbor struct {
MAC net.HardwareAddr
IP ip.IP4
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to support IPv6-only installations? I would assume "yes" and in that case, I would convert this to a pointer as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Still remains unanswered ;)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the heads up, I had forgot about this. Yes! Good idea. I must change this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After looking a bit more into this, I think this change should be prepared in a separated PR because it requires a not small refactor. I created an issue about this => #1453

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, sounds good 👍

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@manuelbuil manuelbuil force-pushed the dualstack-cherryPick branch from 5dd8eef to 78bd70c Compare June 15, 2021 08:20
Copy link

@jojimt jojimt left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

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

LGTM, but needs rebase

Add new option for flannel daemon to support dual stack:
- "publicIPv6": "IPv6 accessible by other nodes for
  inter-host communication"
- "auto-detect-ipv4": "auto detect ipv4 address of the iface",
  default value is true.
- "auto-detect-ipv6": "auto detect ipv6 address of the iface",
  default value is false

Add new option into `net-conf.json` configuration, like following:
{
  "EnableIPv4": true,
  "EnableIPv6": true,
  "Network": "172.16.0.0/16",
  "IPv6Network": "fc00::/48",
  "Backend": {
    "Type": "vxlan"
  }
}
EnableIPv4 default value is true for useing kube subnet manager.
EnableIpv6 default value is false.

Flannel dual stack feature has limitation, only work with vxlan backend
and kube subnet manager now. To enable flannel dual stack feature, need
to do the following step:
1. setting flanneld daemon with "--kube-subnet-mgr --auto-detect-ipv6"
2. settting "EnableIPv6" and "IPv6Network" in "net-conf.json" like the
above configuration.
3. setting network interface that flannel used ipv6 address and
default ipv6 gateway in the host node.
4. vxlan support ipv6 tunnel require kernel version >= 3.12.

Signed-off-by: yaoice <[email protected]>
@manuelbuil manuelbuil force-pushed the dualstack-cherryPick branch 2 times, most recently from 5ab3214 to ba9a55d Compare July 2, 2021 07:37
This patch addresses the reviews made on the original PR

Signed-off-by: Manuel Buil <[email protected]>
@abh
Copy link

abh commented Dec 26, 2021

Should this have closed #248?

@manuelbuil
Copy link
Collaborator Author

Should this have closed #248?

Not exactly. Because flannel does not support ipv6 only yet

@manuelbuil manuelbuil deleted the dualstack-cherryPick branch February 18, 2022 15:15
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

Successfully merging this pull request may close these issues.

6 participants