From 569180f54b374b8362c995dac8bf358c7d32a464 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Wed, 27 Apr 2022 17:38:16 -0500 Subject: [PATCH] Re-add net.bridge settings for flannel This was originally only set on Centos 7 / RHEL 7 but we're experiencing similar issues on Amazon Linux 2 --- nodeup/pkg/model/sysctls.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nodeup/pkg/model/sysctls.go b/nodeup/pkg/model/sysctls.go index 5af839c5fc853..8cf8b7fa7c968 100644 --- a/nodeup/pkg/model/sysctls.go +++ b/nodeup/pkg/model/sysctls.go @@ -134,6 +134,19 @@ func (b *SysctlBuilder) Build(c *fi.ModelBuilderContext) error { "") } + // Running Flannel on Amazon Linux 2 needs custom settings + if b.Cluster.Spec.Networking.Flannel != nil && b.Distribution == distributions.DistributionAmazonLinux2 { + proxyMode := b.Cluster.Spec.KubeProxy.ProxyMode + if proxyMode == "" || proxyMode == "iptables" { + sysctls = append(sysctls, + "# Flannel settings on Amazon Linux 2", + "# Issue https://github.com/coreos/flannel/issues/902", + "net.bridge.bridge-nf-call-ip6tables=1", + "net.bridge.bridge-nf-call-iptables=1", + "") + } + } + if b.Cluster.Spec.IsIPv6Only() { if b.Distribution == distributions.DistributionDebian11 { // Accepting Router Advertisements must be enabled for each existing network interface to take effect.