Skip to content

Commit

Permalink
Faster eni scaleup
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Chen committed Jan 5, 2024
1 parent 3c20f2b commit 5acf19f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ipamd/ipamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 5acf19f

Please sign in to comment.