Skip to content

Commit f91d492

Browse files
jchen6585Joseph Chen
and
Joseph Chen
authored
Faster eni scaleup (#2744)
Co-authored-by: Joseph Chen <[email protected]>
1 parent 1de6c1d commit f91d492

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/ipamd/ipamd.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,11 @@ func (c *IPAMContext) updateIPPoolIfRequired(ctx context.Context) {
652652
log.Debugf("IP stats - total IPs: %d, assigned IPs: %d, cooldown IPs: %d", stats.TotalIPs, stats.AssignedIPs, stats.CooldownIPs)
653653

654654
if datastorePoolTooLow {
655-
c.increaseDatastorePool(ctx)
655+
// Allow for rapid scale up to decrease time it takes for pod to retrieve an ip
656+
// but conservative scale down to account for pod churn
657+
for datastorePoolStillTooLow := datastorePoolTooLow; datastorePoolStillTooLow; datastorePoolStillTooLow, _ = c.isDatastorePoolTooLow() {
658+
c.increaseDatastorePool(ctx)
659+
}
656660
} else if c.isDatastorePoolTooHigh(stats) {
657661
c.decreaseDatastorePool(decreaseIPPoolInterval)
658662
}

0 commit comments

Comments
 (0)