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