From 5b3a6806fe609a98a62b872da1cb25d2499573cb Mon Sep 17 00:00:00 2001 From: Satish Kumar Matti Date: Wed, 12 Apr 2023 15:27:31 -0700 Subject: [PATCH] Skip setting node IP annotation if CALICO_NETWORKING_BACKEND=none `projectcalico.org/IPv4Address` and `projectcalico.org/IPv4IPIPTunnelAddr` annotations are used for BGP so disabling these in `policy` only mode --- node/pkg/lifecycle/startup/startup.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/node/pkg/lifecycle/startup/startup.go b/node/pkg/lifecycle/startup/startup.go index b963a951026..77c5058902d 100644 --- a/node/pkg/lifecycle/startup/startup.go +++ b/node/pkg/lifecycle/startup/startup.go @@ -182,10 +182,9 @@ func Run() { } } - configureAndCheckIPAddressSubnets(ctx, cli, node, k8sNode) - // If Calico is running in policy only mode we don't need to write BGP related details to the Node. if os.Getenv("CALICO_NETWORKING_BACKEND") != "none" { + configureAndCheckIPAddressSubnets(ctx, cli, node, k8sNode) // Configure the node AS number. configureASNumber(node) } @@ -310,6 +309,12 @@ func configureAndCheckIPAddressSubnets(ctx context.Context, cli client.Interface } func MonitorIPAddressSubnets() { + // If Calico is running in policy only mode we don't need to write BGP + // related details to the Node. + if os.Getenv("CALICO_NETWORKING_BACKEND") == "none" { + log.Info("Skipped monitoring node IP changes when CALICO_NETWORKING_BACKEND=none") + return + } ctx := context.Background() _, cli := calicoclient.CreateClient() nodeName := utils.DetermineNodeName()