From 5acf19fe5b42a1a41ac3a5c4afb80bb4c2944b62 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 5 Jan 2024 20:03:48 +0000 Subject: [PATCH] Faster eni scaleup --- pkg/ipamd/ipamd.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/ipamd/ipamd.go b/pkg/ipamd/ipamd.go index 7f958647e8..c190d708fa 100644 --- a/pkg/ipamd/ipamd.go +++ b/pkg/ipamd/ipamd.go @@ -529,7 +529,8 @@ func (c *IPAMContext) nodeInit() error { // On node init, check if datastore pool needs to be increased. If so, attach CIDRs from existing ENIs and attach new ENIs. if !c.disableENIProvisioning && c.isDatastorePoolTooLow() { - if err := c.increaseDatastorePool(ctx); err != nil { + err := c.increaseDatastorePool(ctx) + if err != nil { // Note that the only error currently returned by increaseDatastorePool is an error attaching CIDRs (other than insufficient IPs) podENIErrInc("nodeInit") return errors.New("error while trying to increase datastore pool") @@ -636,6 +637,10 @@ func (c *IPAMContext) updateIPPoolIfRequired(ctx context.Context) { if c.isDatastorePoolTooLow() { c.increaseDatastorePool(ctx) + // Speeds up ENI scale up + for c.isDatastorePoolTooLow() { + c.increaseDatastorePool(ctx) + } } else if c.isDatastorePoolTooHigh() { c.decreaseDatastorePool(decreaseIPPoolInterval) }