From f49d79e70d0ae8ac0c9d4d0a930cbe5418f9c62d Mon Sep 17 00:00:00 2001 From: rbrtbnfgl Date: Thu, 17 Feb 2022 10:53:34 +0100 Subject: [PATCH 1/2] Fixed check for podCIDR in case IPv4 is disabled Signed-off-by: rbrtbnfgl --- main.go | 4 ++-- subnet/kube/kube.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 96b459fb9a..35382824bf 100644 --- a/main.go +++ b/main.go @@ -716,7 +716,7 @@ func LookupExtIface(ifname string, ifregexS string, ipStack int) (*backend.Exter log.Infof("Using %s as external address", extAddr) } - if extAddr == nil { + if extAddr == nil && ipStack != ipv6Stack { log.Infof("Defaulting external address to interface address (%s)", ifaceAddr) extAddr = ifaceAddr } @@ -729,7 +729,7 @@ func LookupExtIface(ifname string, ifregexS string, ipStack int) (*backend.Exter log.Infof("Using %s as external address", extV6Addr) } - if extV6Addr == nil { + if extV6Addr == nil && ipStack != ipv4Stack { log.Infof("Defaulting external v6 address to interface address (%s)", ifaceV6Addr) extV6Addr = ifaceV6Addr } diff --git a/subnet/kube/kube.go b/subnet/kube/kube.go index 0e5c09ae90..c3a36d5f38 100644 --- a/subnet/kube/kube.go +++ b/subnet/kube/kube.go @@ -349,7 +349,7 @@ func (ksm *kubeSubnetManager) AcquireLease(ctx context.Context, attrs *subnet.Le Attrs: *attrs, Expiration: time.Now().Add(24 * time.Hour), } - if cidr != nil { + if cidr != nil && ksm.enableIPv4 { lease.Subnet = ip.FromIPNet(cidr) } if ipv6Cidr != nil { From 2d2459f90f8a25294acb7e95beb6b57f273b36df Mon Sep 17 00:00:00 2001 From: Roberto Bonafiglia Date: Fri, 18 Feb 2022 15:03:32 +0100 Subject: [PATCH 2/2] Update configuration.md --- Documentation/configuration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/configuration.md b/Documentation/configuration.md index 0ecdcad374..1b2c65fdb2 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -105,3 +105,7 @@ FLANNEL_IPV6_SUBNET=2001:cafe:42::1/64 FLANNEL_MTU=1450 FLANNEL_IPMASQ=true ``` + +## IPv6 only + +To use an IPv6 only environment use the same configuration of the Dual-stack to enable IPv6 and add "EnableIPv4": false in the net-conf.json of the kube-flannel-cfg ConfigMap