const.go 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. Copyright 2019 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package service
  14. import (
  15. "time"
  16. )
  17. const (
  18. // RespondingTimeout is how long to wait for a service to be responding.
  19. RespondingTimeout = 2 * time.Minute
  20. // MaxNodesForEndpointsTests is the max number for testing endpoints.
  21. // Don't test with more than 3 nodes.
  22. // Many tests create an endpoint per node, in large clusters, this is
  23. // resource and time intensive.
  24. MaxNodesForEndpointsTests = 3
  25. )
  26. const (
  27. // KubeProxyLagTimeout is the maximum time a kube-proxy daemon on a node is allowed
  28. // to not notice a Service update, such as type=NodePort.
  29. // TODO: This timeout should be O(10s), observed values are O(1m), 5m is very
  30. // liberal. Fix tracked in #20567.
  31. KubeProxyLagTimeout = 5 * time.Minute
  32. // KubeProxyEndpointLagTimeout is the maximum time a kube-proxy daemon on a node is allowed
  33. // to not notice an Endpoint update.
  34. KubeProxyEndpointLagTimeout = 30 * time.Second
  35. // LoadBalancerLagTimeoutDefault is the maximum time a load balancer is allowed to
  36. // not respond after creation.
  37. LoadBalancerLagTimeoutDefault = 2 * time.Minute
  38. // LoadBalancerLagTimeoutAWS is the delay between ELB creation and serving traffic
  39. // on AWS. A few minutes is typical, so use 10m.
  40. LoadBalancerLagTimeoutAWS = 10 * time.Minute
  41. // LoadBalancerCreateTimeoutDefault is the default time to wait for a load balancer to be created/modified.
  42. // TODO: once support ticket 21807001 is resolved, reduce this timeout back to something reasonable
  43. LoadBalancerCreateTimeoutDefault = 20 * time.Minute
  44. // LoadBalancerCreateTimeoutLarge is the maximum time to wait for a load balancer to be created/modified.
  45. LoadBalancerCreateTimeoutLarge = 2 * time.Hour
  46. // LoadBalancerPropagationTimeoutDefault is the default time to wait for pods to
  47. // be targeted by load balancers.
  48. LoadBalancerPropagationTimeoutDefault = 10 * time.Minute
  49. // LoadBalancerCleanupTimeout is the time required by the loadbalancer to cleanup, proportional to numApps/Ing.
  50. // Bring the cleanup timeout back down to 5m once b/33588344 is resolved.
  51. LoadBalancerCleanupTimeout = 15 * time.Minute
  52. // LoadBalancerPollTimeout is the time required by the loadbalancer to poll.
  53. // On average it takes ~6 minutes for a single backend to come online in GCE.
  54. LoadBalancerPollTimeout = 22 * time.Minute
  55. // LoadBalancerPollInterval is the interval value in which the loadbalancer polls.
  56. LoadBalancerPollInterval = 30 * time.Second
  57. // LargeClusterMinNodesNumber is the number of nodes which a large cluster consists of.
  58. LargeClusterMinNodesNumber = 100
  59. // TestTimeout is used for most polling/waiting activities
  60. TestTimeout = 60 * time.Second
  61. // ServiceEndpointsTimeout is the maximum time in which endpoints for the service should be created.
  62. ServiceEndpointsTimeout = 2 * time.Minute
  63. // ServiceReachabilityShortPollTimeout is the maximum time in which service must be reachable during polling.
  64. ServiceReachabilityShortPollTimeout = 2 * time.Minute
  65. )