Skip to content

Commit

Permalink
Faster eni scaleup (#2744)
Browse files Browse the repository at this point in the history
Co-authored-by: Joseph Chen <[email protected]>
  • Loading branch information
jchen6585 and Joseph Chen authored Jan 10, 2024
1 parent 1de6c1d commit f91d492
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ipamd/ipamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,11 @@ func (c *IPAMContext) updateIPPoolIfRequired(ctx context.Context) {
log.Debugf("IP stats - total IPs: %d, assigned IPs: %d, cooldown IPs: %d", stats.TotalIPs, stats.AssignedIPs, stats.CooldownIPs)

if datastorePoolTooLow {
c.increaseDatastorePool(ctx)
// Allow for rapid scale up to decrease time it takes for pod to retrieve an ip
// but conservative scale down to account for pod churn
for datastorePoolStillTooLow := datastorePoolTooLow; datastorePoolStillTooLow; datastorePoolStillTooLow, _ = c.isDatastorePoolTooLow() {
c.increaseDatastorePool(ctx)
}
} else if c.isDatastorePoolTooHigh(stats) {
c.decreaseDatastorePool(decreaseIPPoolInterval)
}
Expand Down

0 comments on commit f91d492

Please sign in to comment.