Skip to content

Commit

Permalink
Remove remaining node update calls in calico-node startup
Browse files Browse the repository at this point in the history
Followup to projectcalico#7550

Change-Id: Icb738cf2d2f84c175812ac12b31c95f63139fe31
  • Loading branch information
skmatti committed May 29, 2023
1 parent 03b7805 commit 9fc3cac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
6 changes: 4 additions & 2 deletions node/filesystem/etc/rc.local
Expand Up @@ -36,8 +36,10 @@ if [ -z "$CALICO_DISABLE_FELIX" ]; then
cp -a /etc/service/available/felix /etc/service/enabled/
fi

# Monitor change in node IP addresses and subnets.
cp -a /etc/service/available/monitor-addresses /etc/service/enabled/
if [ "$CALICO_NETWORKING_BACKEND" != "none" ]; then
# Monitor change in node IP addresses and subnets.
cp -a /etc/service/available/monitor-addresses /etc/service/enabled/
fi

# Enable the allocate tunnel IP service
cp -a /etc/service/available/allocate-tunnel-addrs /etc/service/enabled/
Expand Down
22 changes: 7 additions & 15 deletions node/pkg/lifecycle/startup/startup.go
Expand Up @@ -187,20 +187,18 @@ func Run() {
configureAndCheckIPAddressSubnets(ctx, cli, node, k8sNode)
// Configure the node AS number.
configureASNumber(node)
// Populate a reference to the node based on orchestrator node identifiers.
configureNodeRef(node)
// Apply the updated node resource.
if _, err := CreateOrUpdate(ctx, cli, node); err != nil {
log.WithError(err).Errorf("Unable to set node resource configuration")
utils.Terminate()
}
}

// Populate a reference to the node based on orchestrator node identifiers.
configureNodeRef(node)

// Check expected filesystem
ensureFilesystemAsExpected()

// Apply the updated node resource.
if _, err := CreateOrUpdate(ctx, cli, node); err != nil {
log.WithError(err).Errorf("Unable to set node resource configuration")
utils.Terminate()
}

// Configure IP Pool configuration.
configureIPPools(ctx, cli, kubeadmConfig)

Expand Down Expand Up @@ -309,12 +307,6 @@ 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 9fc3cac

Please sign in to comment.