From f83fe780ca0c8b4e4148dd137bb59baf1c250682 Mon Sep 17 00:00:00 2001 From: Gaurav Khatri Date: Fri, 31 Jul 2020 15:36:45 -0700 Subject: [PATCH] Set routeSource in Felix configuration to WorkloadIPs for non-Calico CNI --- pkg/render/node.go | 4 ++++ pkg/render/node_test.go | 1 + 2 files changed, 5 insertions(+) diff --git a/pkg/render/node.go b/pkg/render/node.go index 4ffdbb564d..08c9c32b9e 100644 --- a/pkg/render/node.go +++ b/pkg/render/node.go @@ -1022,6 +1022,10 @@ func (c *nodeComponent) nodeEnvVars() []v1.EnvVar { } nodeEnv = append(nodeEnv, v1.EnvVar{Name: "FELIX_IPTABLESBACKEND", Value: "auto"}) + if c.cr.Spec.CNI.Type != operator.PluginCalico { + nodeEnv = append(nodeEnv, v1.EnvVar{Name: "FELIX_ROUTESOURCE", Value: "WorkloadIPs"}) + } + if c.amazonCloudInt != nil { nodeEnv = append(nodeEnv, GetTigeraSecurityGroupEnvVariables(c.amazonCloudInt)...) nodeEnv = append(nodeEnv, v1.EnvVar{ diff --git a/pkg/render/node_test.go b/pkg/render/node_test.go index 17b59f11eb..400f3848ba 100644 --- a/pkg/render/node_test.go +++ b/pkg/render/node_test.go @@ -739,6 +739,7 @@ var _ = Describe("Node rendering tests", func() { {Name: "FELIX_IPTABLESBACKEND", Value: "auto"}, {Name: "FELIX_INTERFACEPREFIX", Value: "eni"}, {Name: "FELIX_IPTABLESMANGLEALLOWACTION", Value: "Return"}, + {Name: "FELIX_ROUTESOURCE", Value: "WorkloadIPs"}, } Expect(ds.Spec.Template.Spec.Containers[0].Env).To(ConsistOf(expectedNodeEnv))