Unverified Commit a2ee72d6 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #64153 from liggitt/automated-cherry-pick-of-#61459-upstream-release-1.10

Automatic merge from submit-queue. Automated cherry pick of #61459: etcd client add dial timeout Cherry pick of #61459 on release-1.10. Fixes https://github.com/kubernetes/kubernetes/issues/62538 #61459: etcd client add dial timeout ```release-note kube-apiserver now sets a dial timeout when connecting to etcd, to allow it to tolerate/retry connections to a dead etcd server ```
parents ca8dea7f d4961bc4
...@@ -29,11 +29,13 @@ import ( ...@@ -29,11 +29,13 @@ import (
"k8s.io/apiserver/pkg/storage/value" "k8s.io/apiserver/pkg/storage/value"
) )
// The short keepalive timeout and interval have been chosen to aggressively
// detect a failed etcd server without introducing much overhead.
var ( var (
// The short keepalive timeout and interval have been chosen to aggressively
// detect a failed etcd server without introducing much overhead.
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 ...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment