K8s: reduce discovery requests pressure on aggregated services (#101012)
This commit is contained in:
@@ -204,6 +204,10 @@ func (c *AvailableConditionController) sync(key string) error {
|
|||||||
results := make(chan error, attempts)
|
results := make(chan error, attempts)
|
||||||
for i := 0; i < attempts; i++ {
|
for i := 0; i < attempts; i++ {
|
||||||
go func() {
|
go func() {
|
||||||
|
// stagger these requests to reduce pressure on aggregated services
|
||||||
|
waitDuration := time.Second * time.Duration(int32(i))
|
||||||
|
time.Sleep(waitDuration)
|
||||||
|
|
||||||
discoveryURL, err := c.serviceResolver.ResolveEndpoint(apiService.Spec.Service.Namespace, apiService.Spec.Service.Name, *apiService.Spec.Service.Port)
|
discoveryURL, err := c.serviceResolver.ResolveEndpoint(apiService.Spec.Service.Namespace, apiService.Spec.Service.Name, *apiService.Spec.Service.Port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
results <- err
|
results <- err
|
||||||
|
|||||||
Reference in New Issue
Block a user