Added iptables masquerade rules for ipv6 on flannel

Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@gmail.com>
This commit is contained in:
Roberto Bonafiglia 2022-01-12 17:09:38 +01:00
parent e7464a17f7
commit 2253f64b2a

View File

@ -71,6 +71,11 @@ func flannel(ctx context.Context, flannelIface *net.Interface, flannelConf, kube
go network.SetupAndEnsureIPTables(network.MasqRules(config.Network, bn.Lease()), 60)
go network.SetupAndEnsureIPTables(network.ForwardRules(config.Network.String()), 50)
if config.IPv6Network.String() != emptyIPv6Network {
go network.SetupAndEnsureIP6Tables(network.MasqIP6Rules(config.IPv6Network, bn.Lease()), 60)
go network.SetupAndEnsureIP6Tables(network.ForwardRules(config.IPv6Network.String()), 50)
}
if err := WriteSubnetFile(subnetFile, config.Network, config.IPv6Network, true, bn); err != nil {
// Continue, even though it failed.
logrus.Warningf("Failed to write flannel subnet file: %s", err)