mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
etcd client add dial timeout
This commit is contained in:
parent
18d9e1c450
commit
814401fc90
@ -29,11 +29,13 @@ import (
|
|||||||
"k8s.io/apiserver/pkg/storage/value"
|
"k8s.io/apiserver/pkg/storage/value"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
// The short keepalive timeout and interval have been chosen to aggressively
|
// The short keepalive timeout and interval have been chosen to aggressively
|
||||||
// detect a failed etcd server without introducing much overhead.
|
// detect a failed etcd server without introducing much overhead.
|
||||||
var (
|
|
||||||
keepaliveTime = 30 * time.Second
|
keepaliveTime = 30 * time.Second
|
||||||
keepaliveTimeout = 10 * time.Second
|
keepaliveTimeout = 10 * time.Second
|
||||||
|
// dialTimeout is the timeout for failing to establish a connection.
|
||||||
|
dialTimeout = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func newETCD3Storage(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
|
func newETCD3Storage(c storagebackend.Config) (storage.Interface, DestroyFunc, error) {
|
||||||
@ -52,6 +54,7 @@ func newETCD3Storage(c storagebackend.Config) (storage.Interface, DestroyFunc, e
|
|||||||
tlsConfig = nil
|
tlsConfig = nil
|
||||||
}
|
}
|
||||||
cfg := clientv3.Config{
|
cfg := clientv3.Config{
|
||||||
|
DialTimeout: dialTimeout,
|
||||||
DialKeepAliveTime: keepaliveTime,
|
DialKeepAliveTime: keepaliveTime,
|
||||||
DialKeepAliveTimeout: keepaliveTimeout,
|
DialKeepAliveTimeout: keepaliveTimeout,
|
||||||
Endpoints: c.ServerList,
|
Endpoints: c.ServerList,
|
||||||
|
Loading…
Reference in New Issue
Block a user