K8s: reduce discovery requests pressure on aggregated services (#101012)

pull/101027/head
Charandas 4 months ago committed by GitHub
parent 66c420e067
commit f69e81facf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      pkg/services/apiserver/aggregator/availableController.go

@ -204,6 +204,10 @@ func (c *AvailableConditionController) sync(key string) error {
results := make(chan error, attempts)
for i := 0; i < attempts; i++ {
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)
if err != nil {
results <- err

Loading…
Cancel
Save