Skip to content

Commit

Permalink
Skip setting node IP annotation if CALICO_NETWORKING_BACKEND=none
Browse files Browse the repository at this point in the history
`projectcalico.org/IPv4Address` and `projectcalico.org/IPv4IPIPTunnelAddr` annotations are used for BGP so disabling these in `policy` only mode
  • Loading branch information
skmatti committed Apr 30, 2023
1 parent 8881892 commit 5b3a680
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions node/pkg/lifecycle/startup/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5b3a680

Please sign in to comment.